AceSegmentWriter  0.4
Write decimal numbers, hex numbers, temperature, clock digits, characters, and strings to seven segment LED modules
Public Member Functions | List of all members
ace_segment::PatternWriter< T_LED_MODULE > Class Template Reference

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 size () const
 Return the number of digits supported by this display instance.
 
void home ()
 Set the cursor to the beginning.
 
uint8_t pos () const
 Return the current cursor position.
 
void pos (uint8_t pos)
 Set the current cursor position.
 
void writePattern (uint8_t pattern)
 Write pattern at the current cursor.
 
void writePatterns (const uint8_t patterns[], uint8_t len)
 Write the array patterns[] of length len to the led module.
 
void writePatterns_P (const uint8_t patterns[], uint8_t len)
 Write the array patterns[] of length len to the led module. More...
 
void setDecimalPointAt (uint8_t pos, bool state=true)
 Write the decimal point for the pos. More...
 
void clear ()
 Clear the entire display.
 
void clearToEnd ()
 Clear the display from pos to the end.
 

Detailed Description

template<typename T_LED_MODULE>
class ace_segment::PatternWriter< T_LED_MODULE >

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.

Template Parameters
T_LED_MODULEthe class of the underlying LED Module, often LedModule but other classes with the same generic public methods can be substituted

Definition at line 108 of file PatternWriter.h.

Constructor & Destructor Documentation

◆ PatternWriter()

template<typename T_LED_MODULE >
ace_segment::PatternWriter< T_LED_MODULE >::PatternWriter ( T_LED_MODULE &  ledModule)
inlineexplicit

Constructor.

Parameters
ledModulean instance of LedModule or one of its subclasses

Definition at line 114 of file PatternWriter.h.

Member Function Documentation

◆ setDecimalPointAt()

template<typename T_LED_MODULE >
void ace_segment::PatternWriter< T_LED_MODULE >::setDecimalPointAt ( uint8_t  pos,
bool  state = true 
)
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 167 of file PatternWriter.h.

◆ writePatterns_P()

template<typename T_LED_MODULE >
void ace_segment::PatternWriter< T_LED_MODULE >::writePatterns_P ( const uint8_t  patterns[],
uint8_t  len 
)
inline

Write the array patterns[] of length len to the led module.

The patterns[] is stored in PROGMEM flash memory.

Definition at line 154 of file PatternWriter.h.


The documentation for this class was generated from the following file: