uSevenSegmentLib
https://github.com/Naguissa/uSevenSegmentLib
|
Really tiny library to basic 7 segments displays. More...
Public Member Functions | |
uSevenSegmentLib (const unsigned char, int[8], int *, unsigned int=40, bool=false) | |
Constructor. | |
void | set (long int) |
Sets a number to all displays. | |
long int | get () |
Gets stored number. | |
void | attachInterrupt () |
Attach timer interrupt. | |
void | zeroFill (bool) |
Sets Zerofill on/off. | |
Static Public Member Functions | |
static void | interrupt (void) |
Main public interrupt loop. | |
Static Public Attributes | |
static uSevenSegmentLib * | instance = NULL |
Static variable assignment to NULL. | |
Really tiny library to basic 7 segments displays.
7 segment displays directly controlled from microcontroller
Common anode and common cathode allowed
Uses multiplexed displays for driving as much displays as it can with minimum pins.
Library depends on uTimerLib library, https://github.com/Naguissa/uTimerLib
uSevenSegmentLib::uSevenSegmentLib | ( | const unsigned char | displays, |
int | pins[8], | ||
int * | muxes, | ||
unsigned int | freq = 40 , |
||
bool | common_anode = false |
||
) |
Constructor.
displays | Number of displays |
pins | array of pins {a, b, c, d, e, f, g, dot} |
muxes | array of common pin for each display |
freq | Optional. Refresh frequency (for all digits, will be multiplied by digits to calculate end result) |
common_anode | Optional. Set true to change to common_anode displays |
void uSevenSegmentLib::attachInterrupt | ( | ) |
Attach timer interrupt.
Needed for usual operation, but you can call loop manually instead
long int uSevenSegmentLib::get | ( | ) |
Gets stored number.
|
static |
Main public interrupt loop.
Calls private loop
void uSevenSegmentLib::set | ( | long int | number | ) |
Sets a number to all displays.
number | to be setted |
void uSevenSegmentLib::zeroFill | ( | bool | zf | ) |
Sets Zerofill on/off.
When enabled all leading digits are light as zero.
bool | zf If true, leading zeros will be displayed |