AceSegmentWriter
0.1.0
Write decimal numbers, hex numbers, temperature, clock digits, characters, and strings to seven segment LED modules
|
The ClockWriter writes "hh:mm" and "yyyy" to the LedModule. More...
#include <ClockWriter.h>
Public Member Functions | |
ClockWriter (T_LED_MODULE &ledModule, uint8_t colonDigit=1) | |
Constructor. More... | |
T_LED_MODULE & | ledModule () |
Get the underlying LedModule. | |
PatternWriter< T_LED_MODULE > & | patternWriter () |
Get the underlying PatternWriter. | |
NumberWriter< T_LED_MODULE > & | numberWriter () |
Get the underlying NumberWriter. | |
void | writeCharAt (uint8_t pos, hexchar_t c) |
Write the hexchar_t 'c' at 'pos'. | |
void | writeChars2At (uint8_t pos, hexchar_t c0, hexchar_t c1) |
Write the 2 hexchar_t 'c0' and 'c1' at 'pos' and 'pos+1'. More... | |
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 number. More... | |
void | writeDec2At (uint8_t pos, uint8_t d) |
Write a 2-digit decimal number at position digit, right justified. More... | |
void | writeDec4At (uint8_t pos, uint16_t dd) |
Write the 4 digit decimal number at pos, right justified, padded with a '0' character. More... | |
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 module. More... | |
void | writeColon (bool state=true) |
Write the colon symbol between 'hh' and 'mm'. More... | |
void | clear () |
Clear the entire display. | |
void | clearToEnd (uint8_t pos) |
Clear the display from pos to the end. | |
The ClockWriter writes "hh:mm" and "yyyy" to the LedModule.
A few other characters are supported.
Definition at line 45 of file ClockWriter.h.
|
inlineexplicit |
Constructor.
ledModule | instance of T_LED_MODULE |
colonDigit | The digit which has the colon (":") character, mapped to bit 7 (i.e. 'H' segment). In many 4-digit LED clock display modules, this is digit 1 (counting from the left, 0-based, so the second digit from the left). |
Definition at line 56 of file ClockWriter.h.
|
inline |
Write a 2-digit BCD number at position, which involves just printing the number as a hexadecimal number.
For example, 0x12 is printed as "12", but 0x1A is printed as "1 ".
Definition at line 95 of file ClockWriter.h.
|
inline |
Write the 2 hexchar_t 'c0' and 'c1' at 'pos' and 'pos+1'.
This is a convenience method because the need to write 2 digits (or 2 spaces) occurs quite frequently when implementing clocks.
Definition at line 85 of file ClockWriter.h.
|
inline |
Write the colon symbol between 'hh' and 'mm'.
state | Set to false to turn off the colon. |
Definition at line 143 of file ClockWriter.h.
|
inline |
Write a 2-digit decimal number at position digit, right justified.
If the number is greater than 100, then print " " (2 spaces). Useful for day, hour, minute, seconds.
Definition at line 108 of file ClockWriter.h.
|
inline |
Write the 4 digit decimal number at pos, right justified, padded with a '0' character.
Useful for year.
Definition at line 121 of file ClockWriter.h.
|
inline |
Write the hour and minutes, and the colon in one-shot, assuming the LED module is a 4-digit clock module.
This is a convenience function.
Definition at line 132 of file ClockWriter.h.