Fork of Adafruit_LEDBackpack by
Diff: Adafruit_LEDBackpack.cpp
- Revision:
- 2:403251cd6392
- Parent:
- 1:f066d5347c60
--- a/Adafruit_LEDBackpack.cpp Fri Aug 16 15:44:44 2013 +0000 +++ b/Adafruit_LEDBackpack.cpp Tue Mar 01 19:55:49 2016 +0000 @@ -106,9 +106,21 @@ x %= 8; - if (color) { + if (color == LED_GREEN) { + // Turn on green LED. displaybuffer[y] |= 1 << x; - } else { + // Turn off red LED. + displaybuffer[y] &= ~(1 << (x+8)); + } else if (color == LED_RED) { + // Turn on red LED. + displaybuffer[y] |= 1 << (x+8); + // Turn off green LED. displaybuffer[y] &= ~(1 << x); + } else if (color == LED_YELLOW) { + // Turn on green and red LED. + displaybuffer[y] |= (1 << (x+8)) | (1 << x); + } else if (color == LED_OFF) { + // Turn off green and red LED. + displaybuffer[y] &= ~(1 << x) & ~(1 << (x+8)); } } \ No newline at end of file