From cf15fd5dd65370a40fc3ddfd08c2e28da725c825 Mon Sep 17 00:00:00 2001 From: Michael Vincent Date: Sun, 10 Oct 2021 15:34:31 -0500 Subject: [PATCH] Fix display number for colon and decimal printChar(':', 0) is used in several places in the code to turn on the colon and decimal point. However, the printChar() code resolves the digit index of 0 to display number 0, but display indexes are one-based so the colon or decimal chars never get displayed. This commit was only tested with a single display and this library appears to have larger limitations with handling colon and decimal chars across multiple displays. Here's a test case that this commit fixes: display.print(" 1:2.3"); --- src/SparkFun_Alphanumeric_Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SparkFun_Alphanumeric_Display.cpp b/src/SparkFun_Alphanumeric_Display.cpp index 4959a66..85e81a8 100644 --- a/src/SparkFun_Alphanumeric_Display.cpp +++ b/src/SparkFun_Alphanumeric_Display.cpp @@ -636,7 +636,7 @@ void HT16K33::printChar(uint8_t displayChar, uint8_t digit) characterPosition = displayChar - '!' + 1; } - uint8_t dispNum = digitPosition / 4; + uint8_t dispNum = (digitPosition / 4) + 1; // Take care of special characters by turning correct segment on if (characterPosition == 14) // '.'