AceSegment
0.8.2
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
|
Write LED segment patterns to the underlying LedModule. More...
#include <PatternWriter.h>
Public Member Functions | |
PatternWriter (T_LED_MODULE &ledModule) | |
Constructor. More... | |
T_LED_MODULE & | ledModule () const |
Return the underlying LedModule. | |
uint8_t | getNumDigits () const |
Return the number of digits supported by this display instance. | |
void | writePatternAt (uint8_t pos, uint8_t pattern) |
Write the pattern for a given pos. More... | |
void | writePatternsAt (uint8_t pos, const uint8_t patterns[], uint8_t len) |
Write the array of patterns of length len , starting at pos . More... | |
void | writePatternsAt_P (uint8_t pos, const uint8_t patterns[], uint8_t len) |
Write the array of patterns of length len , which are stored in flash memory through PROGMEM, starting at pos . More... | |
void | writeDecimalPointAt (uint8_t pos, bool state=true) |
Write the decimal point for the pos. More... | |
void | clear () |
Clear the entire display. | |
void | clearToEnd (uint8_t pos) |
Clear the display from pos to the end. | |
Write LED segment patterns to the underlying LedModule.
Other 'Writer' classes provide additional functionality on top of this class (e.g. NumberWriter, ClockWriter, TemperatureWriter, CharWriter, StringWriter).
This class is stateless and does not contain any virtual functions. If the method calls are made on the PatternWriter object directly, the compiler can optimize away the indirection and call LedModule methods directly.
T_LED_MODULE | the class of the underlying LED Module, often LedModule but other classes with the same generic public methods can be substituted |
Definition at line 46 of file PatternWriter.h.
|
inlineexplicit |
Constructor.
ledModule | an instance of LedModule or one of its subclasses |
Definition at line 52 of file PatternWriter.h.
|
inline |
Write the decimal point for the pos.
Clock LED modules will attach the colon segment to one of the decimal points.
Definition at line 105 of file PatternWriter.h.
|
inline |
Write the pattern for a given pos.
If the pos is out of bounds, the method does nothing.
Definition at line 64 of file PatternWriter.h.
|
inline |
Write the array of patterns
of length len
, starting at pos
.
If an element of patterns attempts to write to a digit beyond the last digit of the LED module, nothing happens.
The default implementation calls writePatternAt(), which should be sufficient in most cases. Subclasses can override if needed.
Definition at line 77 of file PatternWriter.h.
|
inline |
Write the array of patterns
of length len
, which are stored in flash memory through PROGMEM, starting at pos
.
If an element of patterns attempts to write to a digit beyond the last digit of the LED module, nothing happens.
The default implementation calls writePatternAt(), which should be sufficient in most cases. Subclasses can override if needed.
Definition at line 93 of file PatternWriter.h.