AceSegment
0.11.0
A library for rendering seven segment LED displays using the TM1637, TM1638, MAX7219, HT16K33, or 74HC595 controller chips
|
An implementation of LedModule using the TM1638 chip. More...
#include <Tm1638Module.h>
Public Member Functions | |
Tm1638Module (const T_TMII &tmiInterface, const uint8_t *remapArray=nullptr) | |
Constructor. More... | |
void | begin () |
Initialize the module. More... | |
void | end () |
Signal end of usage. More... | |
void | setDisplayOn (bool on=true) |
Turn off the entire display. More... | |
bool | isFlushRequired () const |
Return true if flushing required. | |
void | flush () |
Send segment patterns of all digits plus the brightness to the display. More... | |
![]() | |
LedModule (uint8_t *patterns, uint8_t numDigits) | |
Constructor. More... | |
uint8_t | getNumDigits () const |
Return the number of digits supported by this display instance. | |
void | setPatternAt (uint8_t pos, uint8_t pattern) |
Set the led digit pattern at position pos. | |
uint8_t | getPatternAt (uint8_t pos) const |
Get the led digit pattern at position pos. | |
void | setBrightness (uint8_t brightness) |
Set global brightness of all digits. More... | |
uint8_t | getBrightness () const |
Get the current brightness. | |
Friends | |
class | ::Tm1638ModuleTest_flush |
Additional Inherited Members | |
![]() | |
void | begin () |
Subclasses should call this from its own begin(). | |
void | end () |
Subclasses should call this from its own end(). More... | |
void | setDigitDirty (uint8_t pos) |
Set the dirty bit of digit pos . | |
void | clearDigitDirty (uint8_t pos) |
Clear the dirty bit of digit pos . | |
bool | isDigitDirty (uint8_t pos) const |
Check the dirty bit of digit pos . | |
void | clearDigitsDirty () |
Clear dirty bits of all digits. | |
bool | isAnyDigitDirty () const |
Return true if any digits are dirty. | |
bool | isBrightnessDirty () const |
Check if the brightness level is dirty. | |
void | setBrightnessDirty () |
Mark the brightness as dirty. | |
void | clearBrightnessDirty () |
Clear the dirty bit for brightness. | |
An implementation of LedModule using the TM1638 chip.
The chip communicates using a protocol that is electrically similar to SPI.
T_TMII | class that implements the three wire SPI-like protocol interface for TM1638, usually one of the classes from the AceTMI library: SimpleTmi1638Interface or SimpleTmi1638FastInterface. |
T_DIGITS | number of digits in the LED module (usually 8) |
Definition at line 64 of file Tm1638Module.h.
|
inlineexplicit |
Constructor.
tmiInterface | instance of TM1638 interface class |
remapArray | (optional, nullable) a mapping of the logical digit positions to their physical positions, coudl beuseful for 8-digt LED modules whose digits are wired out of order |
Definition at line 74 of file Tm1638Module.h.
|
inline |
Initialize the module.
The SimpleTmi1638Interface or SimpleTmi1638FastInterface object must be initialized separately.
Definition at line 91 of file Tm1638Module.h.
|
inline |
|
inline |
Send segment patterns of all digits plus the brightness to the display.
Performance, for sending 8 digits (total of 1+1+16+1 = 19 bytes), using a 1 microsecond delay, on an SparkFun Pro Micro (AVR):
The isFlushRequired() method can be used to optimize the number of calls to flush(), but often it is not necessary.
Definition at line 142 of file Tm1638Module.h.
|
inline |
Turn off the entire display.
The brightness is not affected so when it is turned back on, the previous brightness will be used.
Definition at line 112 of file Tm1638Module.h.