AceSegment
0.8.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
|
25 #ifndef ACE_SEGMENT_CLOCK_WRITER_H
26 #define ACE_SEGMENT_CLOCK_WRITER_H
29 #include "NumberWriter.h"
31 namespace ace_segment {
64 uint8_t colonDigit = 1
67 mColonDigit(colonDigit)
94 uint8_t high = (bcd & 0xF0) >> 4;
95 uint8_t low = (bcd & 0x0F);
110 uint8_t bcd = ace_common::decToBcd(d);
120 uint8_t high = dd / 100;
121 uint8_t low = dd - high * 100;
157 uint8_t
const mColonDigit;
void writeHexCharAt(uint8_t pos, hexchar_t c)
Write the hex character c at position pos.
void clearToEnd(uint8_t pos)
Clear the display from pos to the end.
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...
General interface that represents a generic seven-segment LED module with multiple digits.
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 writeChars2At(uint8_t pos, hexchar_t c0, hexchar_t c1)
Write the 2 hexchar_t 'c0' and 'c1' at 'pos' and 'pos+1'.
void writeColon(bool state=true)
Write the colon symbol between 'hh' and 'mm'.
static const hexchar_t kCharMinus
A minus ("-") sign.
void clear()
Clear the entire display.
static const uint8_t kPatternP
The "P" character for "PM".
static const hexchar_t kCharSpace
Blank digit.
void clear()
Clear the entire display.
void writeDecimalPointAt(uint8_t pos, bool state=true)
Write the decimal point for the pos.
LedModule & ledModule()
Get the underlying LedModule.
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.
ClockWriter(LedModule &ledModule, uint8_t colonDigit=1)
Constructor.
void clearToEnd(uint8_t pos)
Clear the display from pos to the end.
void writeDec2At(uint8_t pos, uint8_t d)
Write a 2-digit decimal number at position digit, right justified.
The NumberWriter supports converting decimal and hexadecimal numbers to segment patterns expected by ...
static const hexchar_t kCharSpace
A space character.
LedModule & ledModule()
Get the underlying LedModule.
The ClockWriter writes "hh:mm" and "yyyy" to the LedModule.