This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Public Member Functions | Private Attributes | List of all members
DotBarDisplayLEDs< N > Class Template Reference

A class for LED bars. More...

#include <DotBarDisplayLEDs.hpp>

Inheritance diagram for DotBarDisplayLEDs< N >:
Collaboration diagram for DotBarDisplayLEDs< N >:

Public Member Functions

 DotBarDisplayLEDs (const PinList< N > &ledPins)
 Constructor from list of pins. More...
 
void display (uint8_t value) const
 Display the given number of LEDs on the LED bar. More...
 
void display (float value) const
 Display the given fraction of the LED bar. More...
 
void setMode (DotBarMode mode)
 Set the mode to either dot or bar mode. More...
 
void dotMode ()
 Set the mode to dot mode. More...
 
void barMode ()
 Set the mode to bar mode. More...
 
void begin () const
 Initialize (set LED pins as outputs). More...
 
void displayRange (uint8_t startOn, uint8_t startOff) const
 Turn on a range of the LEDs. More...
 
void set (uint8_t index) const
 Turn on the given LED. More...
 
void clear (uint8_t index) const
 Turn off the given LED. More...
 
void clear () const
 Turn off all LEDs. More...
 
void displayDot (uint8_t led) const
 Turn on a single LED, and turn off all others. More...
 

Private Attributes

DotBarMode mode = DotBarMode::Bar
 
const PinList< N > ledPins
 

Detailed Description

template<uint8_t N>
class DotBarDisplayLEDs< N >

A class for LED bars.

Template Parameters
NThe number of LEDs in the bar.

Definition at line 26 of file DotBarDisplayLEDs.hpp.

Constructor & Destructor Documentation

◆ DotBarDisplayLEDs()

template<uint8_t N>
DotBarDisplayLEDs< N >::DotBarDisplayLEDs ( const PinList< N > &  ledPins)
inline

Constructor from list of pins.

Definition at line 29 of file DotBarDisplayLEDs.hpp.

Member Function Documentation

◆ display() [1/2]

template<uint8_t N>
void DotBarDisplayLEDs< N >::display ( uint8_t  value) const
inline

Display the given number of LEDs on the LED bar.

Parameters
valueThe number of the LED to activate.

Definition at line 37 of file DotBarDisplayLEDs.hpp.

◆ display() [2/2]

template<uint8_t N>
void DotBarDisplayLEDs< N >::display ( float  value) const
inline

Display the given fraction of the LED bar.

Parameters
valueThe fraction of the LED bar to display.

Definition at line 52 of file DotBarDisplayLEDs.hpp.

◆ setMode()

template<uint8_t N>
void DotBarDisplayLEDs< N >::setMode ( DotBarMode  mode)
inline

Set the mode to either dot or bar mode.

Parameters
modeThe mode.

Definition at line 60 of file DotBarDisplayLEDs.hpp.

◆ dotMode()

template<uint8_t N>
void DotBarDisplayLEDs< N >::dotMode ( )
inline

Set the mode to dot mode.

Definition at line 63 of file DotBarDisplayLEDs.hpp.

◆ barMode()

template<uint8_t N>
void DotBarDisplayLEDs< N >::barMode ( )
inline

Set the mode to bar mode.

Definition at line 66 of file DotBarDisplayLEDs.hpp.

◆ begin()

template<uint8_t N>
void LEDs< N >::begin ( ) const
inlineinherited

Initialize (set LED pins as outputs).

Definition at line 32 of file LEDs.hpp.

◆ displayRange()

template<uint8_t N>
void LEDs< N >::displayRange ( uint8_t  startOn,
uint8_t  startOff 
) const
inlineinherited

Turn on a range of the LEDs.

Parameters
startOnThe first LED of the range to turn on (the LEDs before this one are turned off).
startOffThe first LED after the range to turn off.

Definition at line 46 of file LEDs.hpp.

◆ set()

template<uint8_t N>
void LEDs< N >::set ( uint8_t  index) const
inlineinherited

Turn on the given LED.

Definition at line 56 of file LEDs.hpp.

◆ clear() [1/2]

template<uint8_t N>
void LEDs< N >::clear ( uint8_t  index) const
inlineinherited

Turn off the given LED.

Definition at line 62 of file LEDs.hpp.

◆ clear() [2/2]

template<uint8_t N>
void LEDs< N >::clear ( ) const
inlineinherited

Turn off all LEDs.

Definition at line 78 of file LEDs.hpp.

◆ displayDot()

template<uint8_t N>
void LEDs< N >::displayDot ( uint8_t  led) const
inlineinherited

Turn on a single LED, and turn off all others.

Parameters
ledThe LED to turn on.

Definition at line 73 of file LEDs.hpp.

Member Data Documentation

◆ mode

template<uint8_t N>
DotBarMode DotBarDisplayLEDs< N >::mode = DotBarMode::Bar
private

Definition at line 69 of file DotBarDisplayLEDs.hpp.

◆ ledPins

template<uint8_t N>
const PinList<N> LEDs< N >::ledPins
privateinherited

Definition at line 84 of file LEDs.hpp.


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