34
34
#define FORCE_TRANSMIT_INTERVAL 30
35
35
36
36
SI7021 humiditySensor;
37
- SPIFlash flash (8 , 0xEF30 );
37
+ SPIFlash flash (8 , 0x1F65 );
38
38
39
39
MySensor gw;
40
40
@@ -57,10 +57,13 @@ void setup() {
57
57
pinMode (LED_PIN, OUTPUT);
58
58
digitalWrite (LED_PIN, LOW);
59
59
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 ();
61
63
pinMode (TEST_PIN,INPUT);
62
64
digitalWrite (TEST_PIN, HIGH);
63
65
if (!digitalRead (TEST_PIN)) testMode ();
66
+
64
67
digitalWrite (TEST_PIN,LOW);
65
68
digitalWrite (LED_PIN, HIGH);
66
69
@@ -194,27 +197,32 @@ void testMode()
194
197
byte tests = 0 ;
195
198
196
199
Serial.println (F (" Testing peripherals!" ));
200
+ Serial.print (F (" -> SI7021 : " ));
201
+ delay (500 );
197
202
198
203
if (humiditySensor.begin ())
199
204
{
200
- Serial.println (F (" Si7021 ok!" ));
205
+ Serial.println (F (" ok!" ));
201
206
tests ++;
202
207
}
203
208
else
204
209
{
205
- Serial.println (F (" ---> Si7021 FAILED !" ));
210
+ Serial.println (F (" failed !" ));
206
211
}
207
-
212
+ delay (500 );
213
+
214
+ Serial.print (F (" -> Flash : " ));
215
+ delay (500 );
208
216
if (flash.initialize ())
209
217
{
210
- Serial.println (" flash OK! " );
218
+ Serial.println (F ( " ok! " ) );
211
219
tests ++;
212
220
}
213
221
else
214
222
{
215
- Serial.println (F (" ---> flash failed!" ));
223
+ Serial.println (F (" failed!" ));
216
224
}
217
-
225
+ delay ( 500 );
218
226
Serial.println (F (" Test finished" ));
219
227
220
228
if (tests == 2 )
@@ -234,9 +242,9 @@ void testMode()
234
242
while (1 ) // Blink FAILED pattern! Rappidly blinking..
235
243
{
236
244
digitalWrite (LED_PIN, HIGH);
237
- delay (200 );
245
+ delay (100 );
238
246
digitalWrite (LED_PIN, LOW);
239
- delay (200 );
247
+ delay (100 );
240
248
}
241
249
}
242
250
}
0 commit comments