@@ -79,12 +79,12 @@ bool otDeviceSetup(
79
79
}
80
80
Serial.println (" OpenThread setup done. Node is ready." );
81
81
// all fine! LED goes and stays Blue
82
- neopixelWrite (RGB_BUILTIN, 0 , 0 , 64 ); // BLUE ... Swtich is ready!
82
+ neopixelWrite (RGB_BUILTIN, 0 , 0 , 64 ); // BLUE ... Switch is ready!
83
83
return true ;
84
84
}
85
85
86
86
void setupNode () {
87
- // tries to set the Thread Network node and only returns when succeded
87
+ // tries to set the Thread Network node and only returns when succeeded
88
88
bool startedCorrectly = false ;
89
89
while (!startedCorrectly) {
90
90
startedCorrectly |= otDeviceSetup (
@@ -138,19 +138,19 @@ bool otCoapPUT(bool lampState) {
138
138
return false ;
139
139
}
140
140
141
- // this fucntion is used by the Switch mode to check the BOOT Button and send the user action to the Lamp node
141
+ // this function is used by the Switch mode to check the BOOT Button and send the user action to the Lamp node
142
142
void checkUserButton () {
143
143
static long unsigned int lastPress = 0 ;
144
144
const long unsigned int debounceTime = 500 ;
145
- static bool lastLampState = true ; // first button press will turn the Lamp OFF from inital Green
145
+ static bool lastLampState = true ; // first button press will turn the Lamp OFF from initial Green
146
146
147
147
pinMode (USER_BUTTON, INPUT_PULLUP); // C6/H2 User Button
148
148
if (millis () > lastPress + debounceTime && digitalRead (USER_BUTTON) == LOW) {
149
149
lastLampState = !lastLampState;
150
150
if (!otCoapPUT (lastLampState)) { // failed: Lamp Node is not responding due to be off or unreachable
151
151
// timeout from the CoAP PUT message... restart the node.
152
152
neopixelWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... something failed!
153
- Serial.println (" Reseting the Node as Switch... wait." );
153
+ Serial.println (" Resetting the Node as Switch... wait." );
154
154
// start over...
155
155
setupNode ();
156
156
}
0 commit comments