From 63f889982e2786cfd79fb1e17c373116587b722d Mon Sep 17 00:00:00 2001 From: DULAC Philippe Date: Tue, 6 Feb 2024 16:32:36 +0100 Subject: [PATCH] Add files via upload --- Adafruit_LEDBackpack.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Adafruit_LEDBackpack.cpp b/Adafruit_LEDBackpack.cpp index e2a2c3c..5f0c2b3 100644 --- a/Adafruit_LEDBackpack.cpp +++ b/Adafruit_LEDBackpack.cpp @@ -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); @@ -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. @@ -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); } } @@ -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)); } @@ -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(); } @@ -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) { @@ -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;