|
7 | 7 |
|
8 | 8 | The following variables are automatically generated and updated when changes are made to the Thing properties |
9 | 9 |
|
10 | | - bool Switch; |
| 10 | + bool switchButton; |
11 | 11 |
|
12 | 12 | Properties which are marked as READ/WRITE in the Cloud Thing will also have functions |
13 | 13 | which are called when their values are changed from the Dashboard. |
@@ -49,29 +49,29 @@ void loop() { |
49 | 49 | ArduinoCloud.update(); |
50 | 50 | // Your code here |
51 | 51 |
|
52 | | - Switch = !Switch; |
53 | | - if (Switch) { |
54 | | - Loc = { .lat = latMov, .lon = lonMov }; |
55 | | - Color = { .hue = hueRed, .sat = satRed, .bri = briRed }; |
| 52 | + switchButton = !switchButton; |
| 53 | + if (switchButton) { |
| 54 | + location = Location(latMov, lonMov); |
| 55 | + color = Color(hueRed, satRed, briRed); |
56 | 56 | } else { |
57 | | - Loc = { .lat = latArd, .lon = lonArd }; |
58 | | - Color = { .hue = hueGreen, .sat = satGreen, .bri = briGreen }; |
| 57 | + location = Location(latArd, lonArd); |
| 58 | + color = Color(hueGreen, satGreen, briGreen); |
59 | 59 | } |
60 | 60 | delay(5000); |
61 | 61 | } |
62 | 62 |
|
63 | 63 |
|
64 | | -void onSwitchChange() { |
| 64 | +void onSwitchButtonChange() { |
65 | 65 | // Do something |
66 | | - digitalWrite(LED_BUILTIN, Switch); |
| 66 | + digitalWrite(LED_BUILTIN, switchButton); |
67 | 67 | } |
68 | 68 |
|
69 | 69 | void onColorChange() { |
70 | 70 | // Do something |
71 | 71 | Serial.print("Hue = "); |
72 | | - Serial.println(Color.getValue().hue); |
| 72 | + Serial.println(color.getValue().hue); |
73 | 73 | Serial.print("Sat = "); |
74 | | - Serial.println(Color.getValue().sat); |
| 74 | + Serial.println(color.getValue().sat); |
75 | 75 | Serial.print("Bri = "); |
76 | | - Serial.println(Color.getValue().bri); |
| 76 | + Serial.println(color.getValue().bri); |
77 | 77 | } |
0 commit comments