AceSegment
0.4.0
An adjustable, configurable, and extensible framework for rendering seven segment LED displays.
|
25 #ifndef ACE_SEGMENT_CLOCK_WRITER_H
26 #define ACE_SEGMENT_CLOCK_WRITER_H
29 #include "LedDisplay.h"
30 #include "NumberWriter.h"
32 namespace ace_segment {
68 uint8_t colonDigit = 1
70 mNumberWriter(ledDisplay),
71 mColonDigit(colonDigit)
90 uint8_t high = (bcd & 0xF0) >> 4;
91 uint8_t low = (bcd & 0x0F);
108 uint8_t bcd = ace_common::decToBcd(d);
118 uint8_t high = dd / 100;
119 uint8_t low = dd - high * 100;
149 uint8_t
const mColonDigit;
LedDisplay & display() const
Get the underlying LedDisplay.
void writeHexCharAt(uint8_t pos, hexchar_t c)
Write the hex character c at position pos.
void writeCharAt(uint8_t pos, hexchar_t c)
Write the hexchar_t 'c' at 'pos'.
void writeBcd2At(uint8_t pos, uint8_t bcd)
Write a 2-digit BCD number at position, which involves just printing the number as a hexadecimal numb...
void writeHourMinute(uint8_t hh, uint8_t mm)
Write the hour and minutes, and the colon in one-shot, assuming the LED module is a 4-digit clock mod...
void writeColon(bool state=true)
Write the colon symbol between 'hh' and 'mm'.
static const hexchar_t kCharMinus
A minus ("-") sign.
General interface for writing LED segment patterns to the LED display module.
static const uint8_t kPatternP
The "P" character for "PM".
static const hexchar_t kCharSpace
Blank digit.
virtual void writeDecimalPointAt(uint8_t pos, bool state=true)=0
Write the decimal point for the pos.
LedDisplay & display() const
Get the underlying LedDisplay.
uint8_t hexchar_t
The type of the character set supported by many methods in this class, usually containing the string ...
static const hexchar_t kCharMinus
A minus character.
static const uint8_t kPatternA
The "A" character for "AM".
void writeDec4At(uint8_t pos, uint16_t dd)
Write the 4 digit decimal number at pos, right justified, padded with a '0' character.
void writeDec2At(uint8_t pos, uint8_t d)
Write a 2-digit decimal number at position digit, right justified.
static const uint8_t kPatternDegree
The superscript degree symbol for temperature.
The NumberWriter supports converting decimal and hexadecimal numbers to segment patterns expected by ...
static const hexchar_t kCharSpace
A space character.
The ClockWriter writes "hh:mm" and "yyyy" to the LedDisplay.
ClockWriter(LedDisplay &ledDisplay, uint8_t colonDigit=1)
Constructor.