25 #ifndef ACE_SEGMENT_WRITER_CLOCK_WRITER_H
26 #define ACE_SEGMENT_WRITER_CLOCK_WRITER_H
29 #include "PatternWriter.h"
30 #include "NumberWriter.h"
32 namespace ace_segment {
38 template <
typename T_LED_MODULE>
52 uint8_t colonDigit = 1
55 mColonDigit(colonDigit)
59 T_LED_MODULE&
ledModule() {
return mNumberWriter.ledModule(); }
63 return mNumberWriter.patternWriter();
70 void home() { mNumberWriter.home(); }
78 mNumberWriter.writeDec2(hh);
79 mNumberWriter.writeDec2(mm);
89 mNumberWriter.writeDec2(hh, kPatternSpace);
90 mNumberWriter.writeDec2(mm);
100 mNumberWriter.setDecimalPointAt(mColonDigit, state);
104 void clear() { mNumberWriter.clear(); }
115 uint8_t
const mColonDigit;
The ClockWriter writes "hh:mm" and "yyyy" to the LedModule.
void clear()
Clear the entire display.
NumberWriter< T_LED_MODULE > & numberWriter()
Get the underlying NumberWriter.
void clearToEnd()
Clear the display from pos to the end.
ClockWriter(NumberWriter< T_LED_MODULE > &numberWriter, uint8_t colonDigit=1)
Constructor.
void writeHourMinute12(uint8_t hh, uint8_t mm)
Write the hour and minute in 12-hour format (i.e.
PatternWriter< T_LED_MODULE > & patternWriter()
Get the underlying PatternWriter.
void writeHourMinute24(uint8_t hh, uint8_t mm)
Write the hour and minute in 24-hour format (i.e.
void writeColon(bool state=true)
Write the colon symbol between 'hh' and 'mm'.
void home()
Reset cursor to home.
T_LED_MODULE & ledModule()
Get the underlying LedModule.
The NumberWriter supports converting decimal and hexadecimal numbers to segment patterns expected by ...
Write LED segment patterns to the underlying LedModule.