@@ -79,12 +79,12 @@ bool otDeviceSetup(
7979 }
8080 Serial.println (" OpenThread setup done. Node is ready." );
8181 // 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!
8383 return true ;
8484}
8585
8686void 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
8888 bool startedCorrectly = false ;
8989 while (!startedCorrectly) {
9090 startedCorrectly |= otDeviceSetup (
@@ -138,19 +138,19 @@ bool otCoapPUT(bool lampState) {
138138 return false ;
139139}
140140
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
142142void checkUserButton () {
143143 static long unsigned int lastPress = 0 ;
144144 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
146146
147147 pinMode (USER_BUTTON, INPUT_PULLUP); // C6/H2 User Button
148148 if (millis () > lastPress + debounceTime && digitalRead (USER_BUTTON) == LOW) {
149149 lastLampState = !lastLampState;
150150 if (!otCoapPUT (lastLampState)) { // failed: Lamp Node is not responding due to be off or unreachable
151151 // timeout from the CoAP PUT message... restart the node.
152152 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." );
154154 // start over...
155155 setupNode ();
156156 }
0 commit comments