AceSegment  0.4.0
An adjustable, configurable, and extensible framework for rendering seven segment LED displays.
Public Member Functions | List of all members
ace_segment::LedDisplay Class Referenceabstract

General interface for writing LED segment patterns to the LED display module. More...

#include <LedDisplay.h>

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

Public Member Functions

 LedDisplay (uint8_t numDigits)
 
virtual void writePatternAt (uint8_t pos, uint8_t pattern)=0
 Write the pattern for a given pos. More...
 
virtual void writePatternsAt (uint8_t pos, const uint8_t patterns[], uint8_t len)=0
 Write the array of patterns of length len, starting at pos. More...
 
virtual void writePatternsAt_P (uint8_t pos, const uint8_t patterns[], uint8_t len)=0
 Write the array of patterns of length len, which are stored in flash memory through PROGMEM, starting at pos. More...
 
virtual void setBrightnessAt (uint8_t pos, uint8_t brightness)=0
 Write the brightness for a given pos, leaving pattern unchanged. More...
 
virtual void writeDecimalPointAt (uint8_t pos, bool state=true)=0
 Write the decimal point for the pos. More...
 
virtual void setGlobalBrightness (uint8_t brightness)=0
 Set global brightness of all digits, with the brightness value expressed as a fraction of 256. More...
 
virtual void clear ()=0
 Clear all digits to blank pattern.
 
uint8_t getNumDigits () const
 Return the number of digits supported by this display instance.
 

Detailed Description

General interface for writing LED segment patterns to the LED display module.

Various 'Writer' classes provide additional functionality on top of this interface:

Definition at line 42 of file LedDisplay.h.

Member Function Documentation

◆ setBrightnessAt()

virtual void ace_segment::LedDisplay::setBrightnessAt ( uint8_t  pos,
uint8_t  brightness 
)
pure virtual

Write the brightness for a given pos, leaving pattern unchanged.

The maximum brightness is determined by specifics of the subclass. For ScanningDisplay, the maximum brightness is the value of SUBFIELDS-1 template parameter.

A subclass may not support the ability to control the brightness on a per digit basis. In that case, this method does nothing. If the pos is out of bounds, the method also does nothing.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.

◆ setGlobalBrightness()

virtual void ace_segment::LedDisplay::setGlobalBrightness ( uint8_t  brightness)
pure virtual

Set global brightness of all digits, with the brightness value expressed as a fraction of 256.

In other words, 255 is brightest (default); 0 represents off, and 1 is 1/256 of full brightness. If the specific subclass does not support brightness, this method does nothing.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.

◆ writeDecimalPointAt()

virtual void ace_segment::LedDisplay::writeDecimalPointAt ( uint8_t  pos,
bool  state = true 
)
pure virtual

Write the decimal point for the pos.

Clock LED modules will attach the colon segment to one of the decimal points.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.

◆ writePatternAt()

virtual void ace_segment::LedDisplay::writePatternAt ( uint8_t  pos,
uint8_t  pattern 
)
pure virtual

Write the pattern for a given pos.

If the pos is out of bounds, the method does nothing.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.

◆ writePatternsAt()

virtual void ace_segment::LedDisplay::writePatternsAt ( uint8_t  pos,
const uint8_t  patterns[],
uint8_t  len 
)
pure virtual

Write the array of patterns of length len, starting at pos.

If an element of patterns attempts to write to a digit beyond the last digit of the LED module, nothing happens.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.

◆ writePatternsAt_P()

virtual void ace_segment::LedDisplay::writePatternsAt_P ( uint8_t  pos,
const uint8_t  patterns[],
uint8_t  len 
)
pure virtual

Write the array of patterns of length len, which are stored in flash memory through PROGMEM, starting at pos.

If an element of patterns attempts to write to a digit beyond the last digit of the LED module, nothing happens.

Implemented in ace_segment::ScanningDisplay< HW, LM, DIGITS, SUBFIELDS >.


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