diff --git a/libraries/HT16K33/HT16K33.cpp b/libraries/HT16K33/HT16K33.cpp index 884b5f02..a4360d53 100644 --- a/libraries/HT16K33/HT16K33.cpp +++ b/libraries/HT16K33/HT16K33.cpp @@ -1,7 +1,7 @@ // // FILE: HT16K33.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.4 +// VERSION: 0.3.5 // DATE: 2019-02-07 // PURPOSE: Arduino Library for HT16K33 4x7segment display // URL: https://github.com/RobTillaart/HT16K33 @@ -13,11 +13,13 @@ // 0.1.3 2019-10-07 fixed clear, added suppressLeadingZeroPlaces(); // 0.1.4 2019-11-28 added displayRaw(), displayVULeft(), displayVURight() // 0.1.5 2019-11-30 refactor, +// // 0.2.0 2020-06-13 ESP32 support; fix brightness bug; // 0.2.1 2020-07-15 fix #160 - decimal point // 0.2.2 2020-10-04 added displayDate() thanks to bepitama // 0.2.3 2020-10-09 issue #4 add negative values for displayInt() // 0.2.4 2020-10-10 refactor #5 setDigits() iso suppressLeadingZeroPlaces() +// // 0.3.0 2020-10-12 negative float, cache control, extend displayRaw() // 0.3.1 2020-12-28 Arduino-CI, unit test (framework only), // 0.3.2 2021-01-14 add WireN support, @@ -26,6 +28,8 @@ // add displayFloat(f, decimals); // experimental // 0.3.3 2021-05-26 fix #17 add leadingZero flag in displayTIme() [Kudos to OwenDuffy] // 0.3.4 2021-12-19 update library.json, license, minor edits +// 0.3.5 2022-09-23 fix #21 additional LEDs on the display +// used in a special layout :88:8'8 #include "HT16K33.h" @@ -498,6 +502,16 @@ void HT16K33::displayColon(uint8_t on) } +void HT16K33::displayExtraLeds(uint8_t value) +{ + if (value > 30) + { + return; // no leds. + } + writePos(2, value); +} + + void HT16K33::dumpSerial(uint8_t *array, uint8_t point) { // to debug without display diff --git a/libraries/HT16K33/HT16K33.h b/libraries/HT16K33/HT16K33.h index 1c8558d9..1d6ff420 100644 --- a/libraries/HT16K33/HT16K33.h +++ b/libraries/HT16K33/HT16K33.h @@ -2,7 +2,7 @@ // // FILE: HT16K33.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.4 +// VERSION: 0.3.5 // DATE: 2019-02-07 // PURPOSE: Arduino Library for HT16K33 4x7segment display // http://www.adafruit.com/products/1002 @@ -14,7 +14,7 @@ #include "Wire.h" -#define HT16K33_LIB_VERSION (F("0.3.4")) +#define HT16K33_LIB_VERSION (F("0.3.5")) // Characters @@ -90,6 +90,14 @@ public: void displayColon(uint8_t on); // 0 = off void displayRaw(uint8_t *array, bool colon = false); // max control + // from issue #21 - used in special layout :88:8'8 normal = 88:88 or 8.8.8.8 + // value = 0 ==> all off. + // 2 = colon + // 4 = upper left point, left of the 1st digit + // 8 = lower left point, left of the 1st digit + // 16 = upper point between 3rd and 4th digit + void displayExtraLeds(uint8_t value); + bool displayVULeft(uint8_t value); // 0..8 bool displayVURight(uint8_t value); // 0..8 diff --git a/libraries/HT16K33/README.md b/libraries/HT16K33/README.md index a934f058..ecfd042e 100644 --- a/libraries/HT16K33/README.md +++ b/libraries/HT16K33/README.md @@ -119,6 +119,20 @@ These functions are new and still under investigation. - **void display(uint8_t \* array, uint8_t point)** idem + point = position of the digit with point (0..3). - **void displayColon(uint8_t on)** 0 = off, all values other are on. - **void displayRaw(uint8_t \* array, bool colon)** array of 4 bytes to control one 7seg display + colon flag. +- **void displayExtraLeds(uint8_t value)** switch on extra leds. +value is in fact a bit mask see table below. 0 = all off. + +#### Extra Leds table + +| mask | description | +|:------:|:--------------| +| 0x00 | all off +| 0x02 | colon. +| 0x04 | upper left point, left of the 1st digit. +| 0x08 | lower left point, left of the 1st digit. +| 0x10 | upper point between 3rd and 4th digit. + +( based upon issue #21 ) ### Debugging @@ -139,7 +153,8 @@ See examples ## Future -**0.4.0** +#### 0.4.0 + - **bool isDisplayOn()** and similar state functions - configuration byte: 4 bits brightness, 1 bit on off flag, 1 bit cache flag, 2 blink rate - **void setBrightness()** and **uint8_t getBrightness()** @@ -147,8 +162,10 @@ See examples - **void getDigits()** - **FixedPoint()** regular (experimental in 0.3.2) - overflow flag ? or not decision +- move all code to .cpp file + - even the small functions. -**unknown** +#### unknown - VU metering using halve bars allows two VU from 0..8 **new** - VU metering using halve bars allows one VU from 0..17. extension of current VUleft/right - optimize the math if possible - performance and footprint. +float + int division diff --git a/libraries/HT16K33/keywords.txt b/libraries/HT16K33/keywords.txt index e5c34246..6c4c25fe 100644 --- a/libraries/HT16K33/keywords.txt +++ b/libraries/HT16K33/keywords.txt @@ -38,6 +38,8 @@ displayColon KEYWORD2 displayTest KEYWORD2 displayRaw KEYWORD2 +displayExtraLeds KEYWORD2 + displayVULeft KEYWORD2 displayVURight KEYWORD2 diff --git a/libraries/HT16K33/library.json b/libraries/HT16K33/library.json index 4d566767..df8b3327 100644 --- a/libraries/HT16K33/library.json +++ b/libraries/HT16K33/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/HT16K33.git" }, - "version": "0.3.4", + "version": "0.3.5", "license": "MIT", "frameworks": "arduino", "platforms": "*", diff --git a/libraries/HT16K33/library.properties b/libraries/HT16K33/library.properties index 5b65f7eb..722500bf 100644 --- a/libraries/HT16K33/library.properties +++ b/libraries/HT16K33/library.properties @@ -1,5 +1,5 @@ name=HT16K33 -version=0.3.4 +version=0.3.5 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino Library for HT16K33 I2C 4x7segment display