From 07828247b6909a474b38430c82bde74710829e48 Mon Sep 17 00:00:00 2001 From: Lorenzo Flueckiger Date: Sun, 20 Mar 2022 15:06:18 -0700 Subject: [PATCH 1/2] Added method to put the backpack in standby mode for low power applications --- Adafruit_LEDBackpack.cpp | 10 ++++++++++ Adafruit_LEDBackpack.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/Adafruit_LEDBackpack.cpp b/Adafruit_LEDBackpack.cpp index 6a39595..1e607d2 100644 --- a/Adafruit_LEDBackpack.cpp +++ b/Adafruit_LEDBackpack.cpp @@ -322,6 +322,16 @@ void Adafruit_LEDBackpack::clear(void) { } } +void Adafruit_LEDBackpack::end() { + if (i2c_dev) { + // turn off oscillator + uint8_t buffer[1] = {0x20}; + i2c_dev->write(buffer, 1); + // terminate I2C communication + i2c_dev->end(); + } +} + /******************************* QUAD ALPHANUM OBJECT */ Adafruit_AlphaNum4::Adafruit_AlphaNum4(void) {} diff --git a/Adafruit_LEDBackpack.h b/Adafruit_LEDBackpack.h index b34ae15..946c78d 100644 --- a/Adafruit_LEDBackpack.h +++ b/Adafruit_LEDBackpack.h @@ -97,6 +97,11 @@ class Adafruit_LEDBackpack { */ void clear(void); + /*! + @brief Put HT16K33 in standby mode. + */ + void end(void); + uint16_t displaybuffer[8]; ///< Raw display data protected: From dbbb0c4ad4d565739dc1859b74515ec9e28ffeb5 Mon Sep 17 00:00:00 2001 From: Lorenzo Flueckiger Date: Sun, 20 Mar 2022 15:56:05 -0700 Subject: [PATCH 2/2] do not terminate i2c comms (in case more than device is on the bus) --- Adafruit_LEDBackpack.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Adafruit_LEDBackpack.cpp b/Adafruit_LEDBackpack.cpp index 1e607d2..2ab5b03 100644 --- a/Adafruit_LEDBackpack.cpp +++ b/Adafruit_LEDBackpack.cpp @@ -327,8 +327,6 @@ void Adafruit_LEDBackpack::end() { // turn off oscillator uint8_t buffer[1] = {0x20}; i2c_dev->write(buffer, 1); - // terminate I2C communication - i2c_dev->end(); } }