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_TEMPERATURE_WRITER_H
26 #define ACE_SEGMENT_TEMPERATURE_WRITER_H
29 #include "../LedModule.h"
30 #include "NumberWriter.h"
32 namespace ace_segment {
67 uint8_t
writeTempAt(uint8_t pos, int16_t temp, int8_t boxSize = 0) {
83 boxSize >= 1 ? boxSize - 1 : 0);
94 boxSize >= 2 ? boxSize - 2 : 0);
106 boxSize >= 2 ? boxSize - 2 : 0);
void clearToEnd(uint8_t pos)
Clear the display from pos to the end.
void writePatternAt(uint8_t pos, uint8_t pattern)
Write the pattern for a given pos.
uint8_t writeTempAt(uint8_t pos, int16_t temp, int8_t boxSize=0)
Write signed integer temperature without deg or unit within the boxSize.
General interface that represents a generic seven-segment LED module with multiple digits.
static const uint8_t kPatternF
The "F" character for "Farenheit".
static const uint8_t kPatternDegree
The superscript degree symbol for temperature.
uint8_t writeSignedDecimalAt(uint8_t pos, int16_t num, int8_t boxSize=0)
Same as writeUnsignedDecimalAt() but prepends a '-' sign if negative.
TemperatureWriter(LedModule &ledModule)
Constructor.
void clear()
Clear the entire display.
PatternWriter & patternWriter()
Get the underlying LedModule.
The TemperatureWriter supports writing integer temperature values in Celcius or Farenheit.
void clearToEnd(uint8_t pos)
Clear the display from pos to the end.
static const uint8_t kPatternC
The "C" character for "Celcius".
uint8_t writeTempDegFAt(uint8_t pos, int16_t temp, int8_t boxSize=0)
Write integer temperature with degree symbol and 'F' symbol.
PatternWriter & patternWriter()
Get the underlying LedModule.
uint8_t writeTempDegAt(uint8_t pos, int16_t temp, int8_t boxSize=0)
Write integer temperature with degree symbol.
uint8_t writeTempDegCAt(uint8_t pos, int16_t temp, int8_t boxSize=0)
Write integer temperature with degree symbol and 'C' symbol.
The NumberWriter supports converting decimal and hexadecimal numbers to segment patterns expected by ...
Write LED segment patterns to the underlying LedModule.
LedModule & ledModule()
Get the underlying LedModule.
LedModule & ledModule()
Get the underlying LedModule.