Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
phd0 authored Feb 6, 2024
1 parent 75452a3 commit 63f8899
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Adafruit_LEDBackpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void Adafruit_LEDBackpack::blinkRate(uint8_t b) {
}

Adafruit_LEDBackpack::Adafruit_LEDBackpack(void) {}
bool Adafruit_LEDBackpack::begin(uint8_t _addr, TwoWire *theWire) {
bool Adafruit_LEDBackpack::begin(uint8_t _addr, TwoWire* theWire) {
if (i2c_dev)
delete i2c_dev;
i2c_dev = new Adafruit_I2CDevice(_addr, theWire);
Expand Down Expand Up @@ -439,13 +439,16 @@ void Adafruit_24bargraph::setBar(uint8_t bar, uint8_t color) {
displaybuffer[c] |= _BV(a);
// Turn off green LED.
displaybuffer[c] &= ~_BV(a + 8);
} else if (color == LED_YELLOW) {
}
else if (color == LED_YELLOW) {
// Turn on red and green LED.
displaybuffer[c] |= _BV(a) | _BV(a + 8);
} else if (color == LED_OFF) {
}
else if (color == LED_OFF) {
// Turn off red and green LED.
displaybuffer[c] &= ~_BV(a) & ~_BV(a + 8);
} else if (color == LED_GREEN) {
}
else if (color == LED_GREEN) {
// Turn on green LED.
displaybuffer[c] |= _BV(a + 8);
// Turn off red LED.
Expand Down Expand Up @@ -487,7 +490,8 @@ void Adafruit_8x16matrix::drawPixel(int16_t x, int16_t y, uint16_t color) {

if (color) {
displaybuffer[y] |= 1 << x;
} else {
}
else {
displaybuffer[y] &= ~(1 << x);
}
}
Expand Down Expand Up @@ -636,7 +640,7 @@ void Adafruit_BicolorMatrix::drawPixel(int16_t x, int16_t y, uint16_t color) {

Adafruit_7segment::Adafruit_7segment(void) { position = 0; }

void Adafruit_7segment::print(const String &c) { write(c.c_str(), c.length()); }
void Adafruit_7segment::print(const String& c) { write(c.c_str(), c.length()); }

void Adafruit_7segment::print(const char c[]) { write(c, strlen(c)); }

Expand All @@ -661,7 +665,7 @@ void Adafruit_7segment::print(unsigned int n, int base) {

void Adafruit_7segment::println(void) { position = 0; }

void Adafruit_7segment::println(const String &c) {
void Adafruit_7segment::println(const String& c) {
print(c);
println();
}
Expand Down Expand Up @@ -728,7 +732,7 @@ size_t Adafruit_7segment::write(char c) {
return r;
}

size_t Adafruit_7segment::write(const char *buffer, size_t size) {
size_t Adafruit_7segment::write(const char* buffer, size_t size) {
size_t n = 0;

while (n < size) {
Expand Down Expand Up @@ -850,7 +854,8 @@ void Adafruit_7segment::printFloat(double n, uint8_t fracDigits, uint8_t base) {
// did toIntFactor shift the decimal off the display?
if (toIntFactor < 1) {
printError();
} else {
}
else {
// otherwise, display the number
int8_t displayPos = 4;

Expand Down

0 comments on commit 63f8899

Please sign in to comment.