Update test and firmware files to update Pixie every sec

Send a signal to change the color of the light every second to prevent
them from getting “stuck” re:
https://learn.adafruit.com/pixie-3-watt-smart-chainable-led-pixels/

“You do have to send it data every 1 second at a minimum (as a
protection against the bright and hot LEDs staying 'stuck on', they
will eventually timeout if no updates are received)”
This commit is contained in:
Matt 2016-05-12 22:34:38 -04:00
parent e6aca8c6a9
commit a45c8104d8
2 changed files with 19 additions and 0 deletions

View File

@ -20,6 +20,9 @@ volatile int r = 0;
volatile int g = 0;
volatile int b = 0;
unsigned long now; //to be compared to stored values every loop
unsigned long light_time;
const char cmd_light = 'l';
const char cmd_debug = 'd';
@ -44,6 +47,13 @@ void loop () {
cmd(cmd_char);
cmd_char = 'z';
}
now = millis();
//send light signal to pixie every second
if (now - light_time >= 1000) {
light.setPixelColor(0, r, g, b);
light.show();
light_time = now;
}
}
//

View File

@ -28,6 +28,9 @@ volatile int r = 0;
volatile int g = 0;
volatile int b = 0;
unsigned long now; //to be compared to stored values every loop
unsigned long light_time;
const char cmd_light = 'l';
const char cmd_debug = 'd';
@ -54,6 +57,12 @@ void loop () {
cmd(cmd_char);
cmd_char = 'z';
}
now = millis();
if (now - light_time >= 1000) {
light.setPixelColor(0, r, g, b);
light.show();
light_time = now;
}
}
//