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

General interface that represents a generic seven-segment LED module with multiple digits. More...

#include <LedModule.h>

Inheritance diagram for ace_segment::LedModule:
Inheritance graph
[legend]

Public Member Functions

 LedModule (uint8_t numDigits)
 Constructor. More...
 
uint8_t getNumDigits () const
 Return the number of digits supported by this display instance. More...
 
virtual void setPatternAt (uint8_t pos, uint8_t pattern)=0
 Set the led digit pattern at position pos.
 
virtual uint8_t getPatternAt (uint8_t pos)=0
 Get the led digit pattern at position pos.
 
virtual void setBrightness (uint8_t brightness)=0
 Set global brightness of all digits. More...
 

Detailed Description

General interface that represents a generic seven-segment LED module with multiple digits.

Subclasses will support different driver chips (e.g. TM1637, MAX7219, or even a 74HC595).

The digit addressing scheme is normalized at this layer so that digit 0 is the left most digit, and digit 'numDigits-1' is the right most digit. The segment addressing is also normalized so that bit 0 is the 'A' segment, bit 6 is 'G' segment, and bit 7 is the decimal point. If an LED module does not conform to this convention, the implement class for that hardware must remap the digit and segment addresses.

Definition at line 44 of file LedModule.h.

Constructor & Destructor Documentation

◆ LedModule()

ace_segment::LedModule::LedModule ( uint8_t  numDigits)
inlineexplicit

Constructor.

Parameters
numDigitsnumber of digits in the LED module; this value is returned by getNumDigits(). The value is usually a compile-time constant, so it is faster/cheaper to just use the constant value. However, sometimes your code needs this value but it has only a reference/pointer to the LedModule (or one of its subclasses). Then getNumDigits() can be used.

Definition at line 55 of file LedModule.h.

Member Function Documentation

◆ getNumDigits()

uint8_t ace_segment::LedModule::getNumDigits ( ) const
inline

Return the number of digits supported by this display instance.

This method is deliberately non-virtual for performance reasons.

Definition at line 61 of file LedModule.h.

◆ setBrightness()

virtual void ace_segment::LedModule::setBrightness ( uint8_t  brightness)
pure virtual

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