Move light firmware to own dir
Reduce cognitive load of firmware, can only set color. Must set black via client.
This commit is contained in:
parent
d902c26a70
commit
7e1e80f770
|
@ -29,7 +29,7 @@ void setup () {
|
|||
Serial.begin(57600);
|
||||
Serial.flush();
|
||||
pixieSerial.begin(115200); // Pixie REQUIRES this baud rate
|
||||
black();
|
||||
light.setPixelColor(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void loop () {
|
||||
|
@ -44,26 +44,21 @@ void loop () {
|
|||
}
|
||||
|
||||
//
|
||||
//b - off
|
||||
//c - color - followed by String
|
||||
//
|
||||
void cmd (char val) {
|
||||
if (val == 'b') {
|
||||
black();
|
||||
} else if (val == 'c') {
|
||||
if (val == 'c') {
|
||||
colorString();
|
||||
Serial.println("c");//End of action
|
||||
}
|
||||
}
|
||||
|
||||
void black () {
|
||||
light.setPixelColor(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void colorString () {
|
||||
while (Serial.available() == 0) {
|
||||
//Wait for color string
|
||||
}
|
||||
color = Serial.readString();
|
||||
//Serial.println(color);
|
||||
|
||||
commaR = color.indexOf(','); //comma trailing R
|
||||
commaG = color.indexOf(',', commaR + 1);
|
||||
|
@ -80,4 +75,4 @@ void colorString () {
|
|||
a = strA.toInt();
|
||||
|
||||
light.setPixelColor(r, g, b, a);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue