Skip to content

Commit 42505f6

Browse files
authored
Merge pull request #45 from pistolingo/fix-startStringScroll
Fix startStringScroll for non _p strings with length <= MAXDIGITS
2 parents 44d0883 + 3a4cbe1 commit 42505f6

File tree

7 files changed

+36
-4
lines changed

7 files changed

+36
-4
lines changed

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes for TM1637TinyDisplay
22

3+
## v1.12.1 - startStringScroll Fix
4+
5+
* Fix startStringScroll for non _p strings with length <= MAXDIGITS by @pistolingo in https://github.com/jasonacox/TM1637TinyDisplay/pull/45
6+
37
## v1.12.0 - Clear Display Option
48

59
* Update `begin()` function to allow parameter control of display clear and full brightness setting. Default behavior if not specified will be `true` which is the behavior with prior version.

TM1637TinyDisplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ void TM1637TinyDisplay::startStringScroll(const char s[], unsigned int ms, bool
680680
m_animation_frames = strlen(s);
681681
if (m_animation_frames <= MAXDIGITS) {
682682
// no need to scroll, just display it
683-
showString_P(s, m_animation_frames, 0, 0);
683+
showString(s, m_animation_frames, 0, 0);
684684
return;
685685
} else {
686686
m_animation_type = 4;

TM1637TinyDisplay6.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ void TM1637TinyDisplay6::startStringScroll(const char s[], unsigned int ms, bool
683683
m_animation_frames = strlen(s);
684684
if (m_animation_frames <= MAXDIGITS) {
685685
// no need to scroll, just display it
686-
showString_P(s, m_animation_frames, 0, 0);
686+
showString(s, m_animation_frames, 0, 0);
687687
return;
688688
} else {
689689
m_animation_type = 4;

examples/TM1637-6Digit-NonBlockingAnimate/TM1637-6Digit-NonBlockingAnimate.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ void loop()
156156
// non-blocking scrolling of a long string
157157
display.startStringScroll(SRamString, 200);
158158
break;
159+
case 5:
160+
Serial.println("");
161+
Serial.println("Animated Short String Scroll from SRAM");
162+
// non-blocking scrolling of a short string
163+
display.startStringScroll("S-Test", 200);
164+
delay(TEST_DELAY);
165+
break;
166+
case 6:
167+
Serial.println("");
168+
Serial.println("Animated Short String Scroll from PROGMEM");
169+
// non-blocking scrolling of a short string
170+
display.startStringScroll_P("F-Test", 200);
171+
delay(TEST_DELAY);
172+
break;
159173
default:
160174
display.showString("The");
161175
delay(TEST_DELAY);

examples/TM1637-NonBlockingAnimate/TM1637-NonBlockingAnimate.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ void loop()
167167
// non-blocking scrolling of a long string
168168
display.startStringScroll(SRamString, 200);
169169
break;
170+
case 5:
171+
Serial.println("");
172+
Serial.println("Animated Short String Scroll from SRAM");
173+
// non-blocking scrolling of a short string
174+
display.startStringScroll("SRAM", 200);
175+
delay(TEST_DELAY);
176+
break;
177+
case 6:
178+
Serial.println("");
179+
Serial.println("Animated Short String Scroll from PROGMEM");
180+
// non-blocking scrolling of a short string
181+
display.startStringScroll_P("FLAS", 200);
182+
delay(TEST_DELAY);
183+
break;
170184
default:
171185
display.showString("The");
172186
delay(TEST_DELAY);

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TM1637TinyDisplay",
3-
"version": "1.10.0",
3+
"version": "1.12.1",
44
"keywords": "TM1637, tiny, LED, display",
55
"description": "A simple library to display numbers, text and animation on a 4 and 6 digit 7-segment TM1637 based display modules. Offers non-blocking animations and scrolling!",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TM1637TinyDisplay
2-
version=1.12.0
2+
version=1.12.1
33
author=Jason Cox <jason@jasonacox.com>
44
maintainer=Jason Cox <jason@jasonacox.com>
55
sentence=A simple library to display numbers, text and animation on 4 and 6 digit 7-segment TM1637 based display modules. Offers non-blocking animations and scrolling!

0 commit comments

Comments
 (0)