Control Surface master
MIDI Control Surface library for Arduino
Public Member Functions | Private Attributes | List of all members
NoteCCKPLEDBarDriver< NumLEDs > Class Template Reference

#include <MIDI_Inputs/LEDs/NoteCCKPLEDBar.hpp>

Detailed Description

template<uint8_t NumLEDs>
class NoteCCKPLEDBarDriver< NumLEDs >

Callback class that drives a LED dot/bar display based on a note or control change value.

Template Parameters
NumLEDsThe number of LEDs the display has.

Definition at line 15 of file NoteCCKPLEDBar.hpp.

+ Inheritance diagram for NoteCCKPLEDBarDriver< NumLEDs >:
+ Collaboration diagram for NoteCCKPLEDBarDriver< NumLEDs >:

Public Member Functions

 NoteCCKPLEDBarDriver (const AH::PinList< NumLEDs > &leds)
 
void displayBar (uint8_t value)
 
void display (uint16_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...
 
DotBarMode getMode () const
 Get the dot/bar mode. 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 toggleMode ()
 Toggle the dot/bar mode. More...
 
void begin () const
 Initialize (set LED pins as outputs). More...
 
void displayRange (uint16_t startOn, uint16_t startOff) const
 Turn on a range of the LEDs. More...
 
void set (uint16_t index) const
 Turn on the given LED. More...
 
void clear (uint16_t index) const
 Turn off the given LED. More...
 
void clear () const
 Turn off all LEDs. More...
 
void displayDot (uint16_t led) const
 Turn on a single LED, and turn off all others. More...
 

Private Attributes

DotBarMode mode
 
const PinList< N > ledPins
 

Constructor & Destructor Documentation

◆ NoteCCKPLEDBarDriver()

NoteCCKPLEDBarDriver ( const AH::PinList< NumLEDs > &  leds)
inline

Definition at line 17 of file NoteCCKPLEDBar.hpp.

Member Function Documentation

◆ displayBar()

void displayBar ( uint8_t  value)
inline

Definition at line 20 of file NoteCCKPLEDBar.hpp.

◆ display() [1/2]

void display ( uint16_t  value) const
inlineinherited

Display the given number of LEDs on the LED bar.

Parameters
valueThe number of the LED to activate.

Definition at line 40 of file DotBarDisplayLEDs.hpp.

◆ display() [2/2]

void display ( float  value) const
inlineinherited

Display the given fraction of the LED bar.

Parameters
valueThe fraction of the LED bar to display.

Definition at line 55 of file DotBarDisplayLEDs.hpp.

◆ getMode()

DotBarMode getMode ( ) const
inlineinherited

Get the dot/bar mode.

Definition at line 58 of file DotBarDisplayLEDs.hpp.

◆ setMode()

void setMode ( DotBarMode  mode)
inlineinherited

Set the mode to either dot or bar mode.

Parameters
modeThe mode.

Definition at line 66 of file DotBarDisplayLEDs.hpp.

◆ dotMode()

void dotMode ( )
inlineinherited

Set the mode to dot mode.

Definition at line 69 of file DotBarDisplayLEDs.hpp.

◆ barMode()

void barMode ( )
inlineinherited

Set the mode to bar mode.

Definition at line 72 of file DotBarDisplayLEDs.hpp.

◆ toggleMode()

void toggleMode ( )
inlineinherited

Toggle the dot/bar mode.

Definition at line 75 of file DotBarDisplayLEDs.hpp.

◆ begin()

void begin ( ) const
inlineinherited

Initialize (set LED pins as outputs).

Definition at line 34 of file LEDs.hpp.

◆ displayRange()

void displayRange ( uint16_t  startOn,
uint16_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 48 of file LEDs.hpp.

◆ set()

void set ( uint16_t  index) const
inlineinherited

Turn on the given LED.

Definition at line 58 of file LEDs.hpp.

◆ clear() [1/2]

void clear ( uint16_t  index) const
inlineinherited

Turn off the given LED.

Definition at line 64 of file LEDs.hpp.

◆ clear() [2/2]

void clear ( ) const
inlineinherited

Turn off all LEDs.

Definition at line 80 of file LEDs.hpp.

◆ displayDot()

void displayDot ( uint16_t  led) const
inlineinherited

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

Parameters
ledThe LED to turn on.

Definition at line 75 of file LEDs.hpp.

Member Data Documentation

◆ mode

DotBarMode mode
privateinherited

Definition at line 78 of file DotBarDisplayLEDs.hpp.

◆ ledPins

const PinList<N> ledPins
privateinherited

Definition at line 86 of file LEDs.hpp.


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