AceSegment  0.8.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
Public Member Functions | Static Public Attributes | List of all members
ace_segment::TemperatureWriter Class Reference

The TemperatureWriter supports writing integer temperature values in Celcius or Farenheit. More...

#include <TemperatureWriter.h>

Public Member Functions

 TemperatureWriter (LedModule &ledModule)
 Constructor. More...
 
LedModuleledModule ()
 Get the underlying LedModule.
 
PatternWriterpatternWriter ()
 Get the underlying LedModule.
 
uint8_t writeTempAt (uint8_t pos, int16_t temp, int8_t boxSize=0)
 Write signed integer temperature without deg or unit within the boxSize.
 
uint8_t writeTempDegAt (uint8_t pos, int16_t temp, int8_t boxSize=0)
 Write integer temperature with degree symbol. More...
 
uint8_t writeTempDegCAt (uint8_t pos, int16_t temp, int8_t boxSize=0)
 Write integer temperature with degree symbol and 'C' symbol.
 
uint8_t writeTempDegFAt (uint8_t pos, int16_t temp, int8_t boxSize=0)
 Write integer temperature with degree symbol and 'F' symbol.
 
void clear ()
 Clear the entire display.
 
void clearToEnd (uint8_t pos)
 Clear the display from pos to the end.
 

Static Public Attributes

static const uint8_t kPatternDegree = 0b01100011
 The superscript degree symbol for temperature.
 
static const uint8_t kPatternC = 0b00111001
 The "C" character for "Celcius".
 
static const uint8_t kPatternF = 0b01110001
 The "F" character for "Farenheit".
 

Detailed Description

The TemperatureWriter supports writing integer temperature values in Celcius or Farenheit.

Negative values are supported.

Definition at line 38 of file TemperatureWriter.h.

Constructor & Destructor Documentation

◆ TemperatureWriter()

ace_segment::TemperatureWriter::TemperatureWriter ( LedModule ledModule)
inlineexplicit

Constructor.

Parameters
ledModuleinstance of LedModule

Definition at line 54 of file TemperatureWriter.h.

Member Function Documentation

◆ writeTempDegAt()

uint8_t ace_segment::TemperatureWriter::writeTempDegAt ( uint8_t  pos,
int16_t  temp,
int8_t  boxSize = 0 
)
inline

Write integer temperature with degree symbol.

The caller is responsible for verifying that the temp value fits inside the boxSize. For example, if boxSize is 2, then the range of temp value is [-9, 99]. If the boxSize is too small, the digits will bleed to the right of the box.

Returns
number of digits written, including any '-' or space characters

Definition at line 81 of file TemperatureWriter.h.


The documentation for this class was generated from the following file: