Skip to content

Commit

Permalink
Fix same issue as adafruit#10 but for bicolor bar graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdicola committed Jun 27, 2014
1 parent 0f9a382 commit 82598ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Adafruit_LEDBackpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,21 @@ void Adafruit_24bargraph::setBar(uint8_t bar, uint8_t color) {

//Serial.print("Ano = "); Serial.print(a); Serial.print(" Cath = "); Serial.println(c);
if (color == LED_RED) {
displaybuffer[c] |= _BV(a) ;
// Turn on red LED.
displaybuffer[c] |= _BV(a);
// Turn off green LED.
displaybuffer[c] &= ~_BV(a+8);
} else if (color == LED_YELLOW) {
// Turn on red and green LED.
displaybuffer[c] |= _BV(a) | _BV(a+8);
} else if (color == LED_OFF) {
// Turn off red and green LED.
displaybuffer[c] &= ~_BV(a) & ~_BV(a+8);
} else if (color == LED_GREEN) {
displaybuffer[c] |= _BV(a+8) ;
// Turn on green LED.
displaybuffer[c] |= _BV(a+8);
// Turn off red LED.
displaybuffer[c] &= ~_BV(a);
}
}

Expand Down

0 comments on commit 82598ca

Please sign in to comment.