#include <AH/Hardware/LEDs/DotBarDisplayLEDs.hpp>
A class for LED bars.
N | The number of LEDs in the bar. |
Definition at line 26 of file DotBarDisplayLEDs.hpp.
Public Member Functions | |
DotBarDisplayLEDs (const PinList< N > &ledPins) | |
Constructor from list of pins. | |
void | display (uint16_t value) const |
Display the given number of LEDs on the LED bar. | |
void | display (float value) const |
Display the given fraction of the LED bar. | |
DotBarMode | getMode () const |
Get the dot/bar mode. | |
void | setMode (DotBarMode mode) |
Set the mode to either dot or bar mode. | |
void | dotMode () |
Set the mode to dot mode. | |
void | barMode () |
Set the mode to bar mode. | |
void | toggleMode () |
Toggle the dot/bar mode. | |
void | begin () const |
Initialize (set LED pins as outputs). | |
void | displayRange (uint16_t startOn, uint16_t startOff) const |
Turn on a range of the LEDs. | |
void | set (uint16_t index) const |
Turn on the given LED. | |
void | clear (uint16_t index) const |
Turn off the given LED. | |
void | clear () const |
Turn off all LEDs. | |
void | displayDot (uint16_t led) const |
Turn on a single LED, and turn off all others. | |
Private Attributes | |
DotBarMode | mode = DotBarMode::Bar |
const PinList< N > | ledPins |
|
inline |
Constructor from list of pins.
Definition at line 29 of file DotBarDisplayLEDs.hpp.
Display the given number of LEDs on the LED bar.
value | The number of the LED to activate. |
Definition at line 37 of file DotBarDisplayLEDs.hpp.
Display the given fraction of the LED bar.
value | The fraction of the LED bar to display. |
Definition at line 52 of file DotBarDisplayLEDs.hpp.
|
inline |
Get the dot/bar mode.
Definition at line 55 of file DotBarDisplayLEDs.hpp.
|
inline |
Set the mode to either dot or bar mode.
mode | The mode. |
Definition at line 63 of file DotBarDisplayLEDs.hpp.
Set the mode to dot mode.
Definition at line 66 of file DotBarDisplayLEDs.hpp.
Set the mode to bar mode.
Definition at line 69 of file DotBarDisplayLEDs.hpp.
Toggle the dot/bar mode.
Definition at line 72 of file DotBarDisplayLEDs.hpp.
|
private |
Definition at line 75 of file DotBarDisplayLEDs.hpp.