Added calibration mode
This commit is contained in:
parent
baaa63ff46
commit
9ee23cee1b
|
@ -8,6 +8,7 @@
|
||||||
#define GROUND_PIN 10 // additional grounding pin (optional)
|
#define GROUND_PIN 10 // additional grounding pin (optional)
|
||||||
#define BRIGHTNESS 255 // maximum brightness
|
#define BRIGHTNESS 255 // maximum brightness
|
||||||
#define SPEED 115200 // serial port speed, max available
|
#define SPEED 115200 // serial port speed, max available
|
||||||
|
//#define CALIBRATE // uncomment to set calibration mode
|
||||||
|
|
||||||
// If no serial data is received for a while, the LEDs are shut off
|
// If no serial data is received for a while, the LEDs are shut off
|
||||||
// automatically. Value in milliseconds.
|
// automatically. Value in milliseconds.
|
||||||
|
@ -139,8 +140,19 @@ void setup()
|
||||||
|
|
||||||
if(bytesRemaining > 0) {
|
if(bytesRemaining > 0) {
|
||||||
if(bytesBuffered > 0) {
|
if(bytesBuffered > 0) {
|
||||||
if (outPos < sizeof(leds))
|
if (outPos < sizeof(leds)){
|
||||||
ledsRaw[outPos++] = buffer[indexOut++]; // Issue next byte
|
#ifdef CALIBRATE
|
||||||
|
if(outPos < 3)
|
||||||
|
ledsRaw[outPos++] = buffer[indexOut++];
|
||||||
|
else{
|
||||||
|
ledsRaw[outPos] = ledsRaw[outPos%3]; // Sets RGB data to first LED color
|
||||||
|
outPos++;
|
||||||
|
indexOut++;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ledsRaw[outPos++] = buffer[indexOut++]; // Issue next byte
|
||||||
|
#endif
|
||||||
|
}
|
||||||
bytesBuffered--;
|
bytesBuffered--;
|
||||||
bytesRemaining--;
|
bytesRemaining--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue