AceSegment
0.8.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
|
General interface that represents a generic seven-segment LED module with multiple digits. More...
#include <LedModule.h>
Public Member Functions | |
LedModule (uint8_t numDigits) | |
Constructor. More... | |
uint8_t | getNumDigits () const |
Return the number of digits supported by this display instance. More... | |
virtual void | setPatternAt (uint8_t pos, uint8_t pattern)=0 |
Set the led digit pattern at position pos. | |
virtual uint8_t | getPatternAt (uint8_t pos)=0 |
Get the led digit pattern at position pos. | |
virtual void | setBrightness (uint8_t brightness)=0 |
Set global brightness of all digits. More... | |
General interface that represents a generic seven-segment LED module with multiple digits.
Subclasses will support different driver chips (e.g. TM1637, MAX7219, or even a 74HC595).
The digit addressing scheme is normalized at this layer so that digit 0 is the left most digit, and digit 'numDigits-1' is the right most digit. The segment addressing is also normalized so that bit 0 is the 'A' segment, bit 6 is 'G' segment, and bit 7 is the decimal point. If an LED module does not conform to this convention, the implement class for that hardware must remap the digit and segment addresses.
Definition at line 44 of file LedModule.h.
|
inlineexplicit |
Constructor.
numDigits | number of digits in the LED module; this value is returned by getNumDigits(). The value is usually a compile-time constant, so it is faster/cheaper to just use the constant value. However, sometimes your code needs this value but it has only a reference/pointer to the LedModule (or one of its subclasses). Then getNumDigits() can be used. |
Definition at line 55 of file LedModule.h.
|
inline |
Return the number of digits supported by this display instance.
This method is deliberately non-virtual for performance reasons.
Definition at line 61 of file LedModule.h.
|
pure virtual |
Set global brightness of all digits.
Different subclasses will interpret the brightness integer value differently.
Implemented in ace_segment::Max7219Module< T_SPII, T_DIGITS >, ace_segment::Tm1637Module< T_TMII, T_DIGITS >, ace_segment::ScanningModule< T_LM, T_DIGITS, T_SUBFIELDS, T_CI >, ace_segment::ScanningModule< LedMatrixSingleHc595< T_SPII, GpioInterface >, T_DIGITS, 1, ClockInterface >, ace_segment::ScanningModule< LedMatrixDirect< GpioInterface >, T_DIGITS, 1, ClockInterface >, ace_segment::ScanningModule< LedMatrixDirectFast4< e0, e1, e2, e3, e4, e5, e6, e7, g0, g1, g2, g3 >, T_DIGITS, 1, ClockInterface >, ace_segment::ScanningModule< LedMatrixDualHc595< T_SPII >, T_DIGITS, 1, ClockInterface >, and ace_segment::Ht16k33Module< T_WIREI, T_DIGITS >.