From 4bce9d43ff40374b1fb48b4829f47d3f5e2ec05e Mon Sep 17 00:00:00 2001 From: hastypete <59269160+hastypete@users.noreply.github.com> Date: Wed, 18 May 2022 18:44:41 -0700 Subject: [PATCH] Fix to displayHex logical error By doing a mod on the 'hex' parameter it allows function to properly handle integers past 15. --- src/TM1638plus.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TM1638plus.cpp b/src/TM1638plus.cpp index c4076ab..5d78b44 100644 --- a/src/TM1638plus.cpp +++ b/src/TM1638plus.cpp @@ -135,6 +135,7 @@ void TM1638plus::displayASCII(uint8_t position, uint8_t ascii) { void TM1638plus::displayHex(uint8_t position, uint8_t hex) { uint8_t offset = 0; + hex = hex % 16; if (hex <= 9) { display7Seg(position, pgm_read_byte(&SevenSeg[hex + TM_HEX_OFFSET]));