@@ -55,7 +55,7 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
55
55
}
56
56
if (i != nCmds1) {
57
57
log_e (" Sorry, OpenThread Network setup failed!" );
58
- neopixelWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
58
+ rgbLedWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
59
59
return false ;
60
60
}
61
61
Serial.println (" OpenThread started.\r\n Waiting for activating correct Device Role." );
@@ -69,7 +69,7 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
69
69
Serial.println ();
70
70
if (!tries) {
71
71
log_e (" Sorry, Device Role failed by timeout! Current Role: %s." , otGetStringDeviceRole ());
72
- neopixelWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
72
+ rgbLedWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
73
73
return false ;
74
74
}
75
75
Serial.printf (" Device is %s.\r\n " , otGetStringDeviceRole ());
@@ -80,12 +80,12 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
80
80
}
81
81
if (i != nCmds2) {
82
82
log_e (" Sorry, OpenThread CoAP setup failed!" );
83
- neopixelWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
83
+ rgbLedWrite (RGB_BUILTIN, 255 , 0 , 0 ); // RED ... failed!
84
84
return false ;
85
85
}
86
86
Serial.println (" OpenThread setup done. Node is ready." );
87
87
// all fine! LED goes Green
88
- neopixelWrite (RGB_BUILTIN, 0 , 64 , 8 ); // GREEN ... Lamp is ready!
88
+ rgbLedWrite (RGB_BUILTIN, 0 , 64 , 8 ); // GREEN ... Lamp is ready!
89
89
return true ;
90
90
}
91
91
@@ -118,16 +118,16 @@ void otCOAPListen() {
118
118
log_i (" CoAP PUT [%s]\r\n " , payload == ' 0' ? " OFF" : " ON" );
119
119
if (payload == ' 0' ) {
120
120
for (int16_t c = 248 ; c > 16 ; c -= 8 ) {
121
- neopixelWrite (RGB_BUILTIN, c, c, c); // ramp down
121
+ rgbLedWrite (RGB_BUILTIN, c, c, c); // ramp down
122
122
delay (5 );
123
123
}
124
- neopixelWrite (RGB_BUILTIN, 0 , 0 , 0 ); // Lamp Off
124
+ rgbLedWrite (RGB_BUILTIN, 0 , 0 , 0 ); // Lamp Off
125
125
} else {
126
126
for (int16_t c = 16 ; c < 248 ; c += 8 ) {
127
- neopixelWrite (RGB_BUILTIN, c, c, c); // ramp up
127
+ rgbLedWrite (RGB_BUILTIN, c, c, c); // ramp up
128
128
delay (5 );
129
129
}
130
- neopixelWrite (RGB_BUILTIN, 255 , 255 , 255 ); // Lamp On
130
+ rgbLedWrite (RGB_BUILTIN, 255 , 255 , 255 ); // Lamp On
131
131
}
132
132
}
133
133
}
@@ -136,7 +136,7 @@ void otCOAPListen() {
136
136
void setup () {
137
137
Serial.begin (115200 );
138
138
// LED starts RED, indicating not connected to Thread network.
139
- neopixelWrite (RGB_BUILTIN, 64 , 0 , 0 );
139
+ rgbLedWrite (RGB_BUILTIN, 64 , 0 , 0 );
140
140
OThreadCLI.begin (false ); // No AutoStart is necessary
141
141
OThreadCLI.setTimeout (250 ); // waits 250ms for the OpenThread CLI response
142
142
setupNode ();
0 commit comments