File tree 6 files changed +9
-9
lines changed
ArduinoIoTCloud-Callbacks
ArduinoIoTCloud-DeferredOTA
utility/ArduinoIoTCloud_Travis_CI
6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 15
15
void setup () {
16
16
/* Initialize serial and wait up to 5 seconds for port to open */
17
17
Serial.begin (9600 );
18
- for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime > 5000 ); ) { }
18
+ for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime <= 5000 ); ) { }
19
19
20
20
/* This function takes care of connecting your sketch variables to the ArduinoIoTCloud object */
21
21
initProperties ();
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ static int const LED_BUILTIN = 2;
23
23
void setup () {
24
24
/* Initialize serial and wait up to 5 seconds for port to open */
25
25
Serial.begin (9600 );
26
- for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime > 5000 ); ) { }
26
+ for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime <= 5000 ); ) { }
27
27
28
28
/* Configure LED pin as an output */
29
29
pinMode (LED_BUILTIN, OUTPUT);
Original file line number Diff line number Diff line change 8
8
9
9
You don't need any specific Properties to be created in order to demonstrate these functionalities.
10
10
Simply create a new Thing and give it 1 arbitrary Property.
11
- Remember that the Thing ID needs to be configured in thingProperties.h
11
+ Remember that the Thing ID needs to be configured in thingProperties.h
12
12
These events can be very useful in particular cases, for instance to disable a peripheral
13
13
or a connected sensor/actuator when no data connection is available, as well as to perform
14
14
specific operations on connection or right after properties values are synchronised.
31
31
void setup () {
32
32
/* Initialize serial and wait up to 5 seconds for port to open */
33
33
Serial.begin (9600 );
34
- for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime > 5000 ); ) { }
34
+ for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime <= 5000 ); ) { }
35
35
36
36
/* This function takes care of connecting your sketch variables to the ArduinoIoTCloud object */
37
37
initProperties ();
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ bool ask_user_via_serial() {
39
39
if (Serial.available ()) {
40
40
char c = Serial.read ();
41
41
if (c == ' y' || c == ' Y' ) {
42
- return true ;
42
+ return true ;
43
43
}
44
44
}
45
45
return false ;
@@ -56,7 +56,7 @@ bool onOTARequestCallback()
56
56
void setup () {
57
57
/* Initialize serial and wait up to 5 seconds for port to open */
58
58
Serial.begin (9600 );
59
- for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime > 5000 ); ) { }
59
+ for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime <= 5000 ); ) { }
60
60
61
61
/* Configure LED pin as an output */
62
62
pinMode (LED_BUILTIN, OUTPUT);
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ static int const LED_BUILTIN = 2;
15
15
void setup () {
16
16
/* Initialize the serial port and wait up to 5 seconds for a connection */
17
17
Serial.begin (9600 );
18
- for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime > 5000 ); ) { }
18
+ for (unsigned long const serialBeginTime = millis (); !Serial && (millis () - serialBeginTime <= 5000 ); ) { }
19
19
20
20
/* Configure LED pin as an output */
21
21
pinMode (LED_BUILTIN, OUTPUT);
@@ -206,7 +206,7 @@ void loop() {
206
206
if (daily.isActive ()) {
207
207
Serial.println (" Daily schedule is active" );
208
208
}
209
-
209
+
210
210
/* Activate LED when the weekly schedule is active */
211
211
digitalWrite (LED_BUILTIN, weekly.isActive ());
212
212
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ void setup() {
18
18
19
19
Serial.begin (9600 );
20
20
unsigned long serialBeginTime = millis ();
21
- while (!Serial && (millis () - serialBeginTime > 5000 ));
21
+ while (!Serial && (millis () - serialBeginTime <= 5000 ));
22
22
23
23
Serial.println (" Starting Arduino IoT Cloud Example" );
24
24
You can’t perform that action at this time.
0 commit comments