AceSegment
0.7.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
|
25 #ifndef ACE_SEGMENT_STRING_SCROLLER_H
26 #define ACE_SEGMENT_STRING_SCROLLER_H
30 #include "StringWriter.h"
32 class __FlashStringHelper;
34 namespace ace_segment {
58 mIsFlashString =
false;
59 mStringLength = strlen(s);
67 mIsFlashString =
true;
68 mStringLength = strlen_P((
const char*) fs);
78 bool isDone = mStringPos >= mStringLength;
89 mIsFlashString =
false;
90 mStringLength = strlen(s);
91 mStringPos = mStringLength;
98 mIsFlashString =
true;
99 mStringLength = strlen_P((
const char*) fs);
100 mStringPos = mStringLength;
110 bool isDone = (mStringPos <= -numDigits);
125 int16_t stringPos = mStringPos;
126 for (uint8_t pos = 0; pos < numDigits; pos++) {
128 if (stringPos < 0 || stringPos >= mStringLength) {
136 if (mIsFlashString) {
137 c = pgm_read_byte((
const uint8_t*) mString + stringPos);
139 c = *((
const char*) mString + stringPos);
150 CharWriter& mCharWriter;
153 uint8_t mStringLength;
void clear()
Clear the entire display.
General interface that represents a generic seven-segment LED module with multiple digits.
The CharWriter supports mapping of an 8-bit character set to segment patterns supported by LedModule.
LedModule & ledModule() const
Get the underlying LedModule.
void writeCharAt(uint8_t pos, char c)
Write the character at the specified position.
uint8_t getNumDigits() const
Return the number of digits supported by this display instance.