Skip to content

Commit 405c8fd

Browse files
committed
Update testmode, after initial tests on the bench
1 parent 985f9c3 commit 405c8fd

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define FORCE_TRANSMIT_INTERVAL 30
3535

3636
SI7021 humiditySensor;
37-
SPIFlash flash(8, 0xEF30);
37+
SPIFlash flash(8, 0x1F65);
3838

3939
MySensor gw;
4040

@@ -57,10 +57,13 @@ void setup() {
5757
pinMode(LED_PIN, OUTPUT);
5858
digitalWrite(LED_PIN, LOW);
5959

60-
// First check if we should boot into clear eeprom mode
60+
Serial.begin(115200);
61+
// First check if we should boot into test mode
62+
testMode();
6163
pinMode(TEST_PIN,INPUT);
6264
digitalWrite(TEST_PIN, HIGH);
6365
if (!digitalRead(TEST_PIN)) testMode();
66+
6467
digitalWrite(TEST_PIN,LOW);
6568
digitalWrite(LED_PIN, HIGH);
6669

@@ -194,27 +197,32 @@ void testMode()
194197
byte tests = 0;
195198

196199
Serial.println(F("Testing peripherals!"));
200+
Serial.print(F("-> SI7021 : "));
201+
delay(500);
197202

198203
if (humiditySensor.begin())
199204
{
200-
Serial.println(F("Si7021 ok!"));
205+
Serial.println(F("ok!"));
201206
tests ++;
202207
}
203208
else
204209
{
205-
Serial.println(F("---> Si7021 FAILED!"));
210+
Serial.println(F("failed!"));
206211
}
207-
212+
delay(500);
213+
214+
Serial.print(F("-> Flash : "));
215+
delay(500);
208216
if (flash.initialize())
209217
{
210-
Serial.println("flash OK!");
218+
Serial.println(F("ok!"));
211219
tests ++;
212220
}
213221
else
214222
{
215-
Serial.println(F("---> flash failed!"));
223+
Serial.println(F("failed!"));
216224
}
217-
225+
delay(500);
218226
Serial.println(F("Test finished"));
219227

220228
if (tests == 2)
@@ -234,9 +242,9 @@ void testMode()
234242
while (1) // Blink FAILED pattern! Rappidly blinking..
235243
{
236244
digitalWrite(LED_PIN, HIGH);
237-
delay(200);
245+
delay(100);
238246
digitalWrite(LED_PIN, LOW);
239-
delay(200);
247+
delay(100);
240248
}
241249
}
242250
}

0 commit comments

Comments
 (0)