diff --git a/library.properties b/library.properties index 3e93214..b34a359 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SevenSegmentTM1637 -version=1.1.0 +version=1.1.2 author=Bram Harmsen maintainer=Bram Harmsen sentence=Library for using a 4 digit seven segment display with TM1636 or TM1637 driver IC diff --git a/src/SevenSegmentFun.cpp b/src/SevenSegmentFun.cpp index c5a2640..711dbc5 100644 --- a/src/SevenSegmentFun.cpp +++ b/src/SevenSegmentFun.cpp @@ -24,9 +24,9 @@ void SevenSegmentFun::printLevelVertical(uint8_t level, bool leftToRight) { uint8_t d = leftToRight == true?0:TM1637_MAX_COLOM-1; for (uint8_t i=0; i < TM1637_MAX_COLOM; i++) { - if (barsOn - (2 * (i + 1)) >= 0) { + if (barsOn - (2 * i) >= 2) { _rawBuffer[d] = TM1637_CHAR_VERT_LEVEL_II; - } else if (barsOn - (2 * (i + 1)) >= 1) { + } else if (barsOn - (2 * i) >= 1) { _rawBuffer[d] = (leftToRight == true)?TM1637_CHAR_VERT_LEVEL_I0:TM1637_CHAR_VERT_LEVEL_0I; } else { _rawBuffer[d] = 0;