Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
VULEDsDriver< NumLEDs > Class Template Reference

#include <MIDI_Inputs/LEDs/MCU/VULEDs.hpp>

Detailed Description

template<uint16_t NumLEDs>
class MCU::VULEDsDriver< NumLEDs >

Small helper to display the VU meters on an LED bar display.

Definition at line 12 of file VULEDs.hpp.

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

Public Member Functions

 VULEDsDriver (const PinList< NumLEDs > &leds)
 Constructor.
 
void displayVU (uint16_t value)
 
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
 
const PinList< N > ledPins
 

Static Private Attributes

static constexpr uint8_t FLOOR_CORRECTION = 5
 

Constructor & Destructor Documentation

◆ VULEDsDriver()

template<uint16_t NumLEDs>
VULEDsDriver ( const PinList< NumLEDs > & leds)
inline

Constructor.

Definition at line 15 of file VULEDs.hpp.

Member Function Documentation

◆ displayVU()

template<uint16_t NumLEDs>
void displayVU ( uint16_t value)
inline
Parameters
value[0, 12]

Definition at line 20 of file VULEDs.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 37 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 52 of file DotBarDisplayLEDs.hpp.

◆ getMode()

DotBarMode getMode ( ) const
inlineinherited

Get the dot/bar mode.

Definition at line 55 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 63 of file DotBarDisplayLEDs.hpp.

◆ dotMode()

void dotMode ( )
inlineinherited

Set the mode to dot mode.

Definition at line 66 of file DotBarDisplayLEDs.hpp.

◆ barMode()

void barMode ( )
inlineinherited

Set the mode to bar mode.

Definition at line 69 of file DotBarDisplayLEDs.hpp.

◆ toggleMode()

void toggleMode ( )
inlineinherited

Toggle the dot/bar mode.

Definition at line 72 of file DotBarDisplayLEDs.hpp.

◆ begin()

template<uint16_t N>
void begin ( ) const
inlineinherited

Initialize (set LED pins as outputs).

Definition at line 31 of file LEDs.hpp.

◆ displayRange()

template<uint16_t N>
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 45 of file LEDs.hpp.

◆ set()

template<uint16_t N>
void set ( uint16_t index) const
inlineinherited

Turn on the given LED.

Definition at line 55 of file LEDs.hpp.

◆ clear() [1/2]

template<uint16_t N>
void clear ( uint16_t index) const
inlineinherited

Turn off the given LED.

Definition at line 61 of file LEDs.hpp.

◆ clear() [2/2]

template<uint16_t N>
void clear ( ) const
inlineinherited

Turn off all LEDs.

Definition at line 77 of file LEDs.hpp.

◆ displayDot()

template<uint16_t N>
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 72 of file LEDs.hpp.

Member Data Documentation

◆ FLOOR_CORRECTION

template<uint16_t NumLEDs>
constexpr uint8_t FLOOR_CORRECTION = 5
staticconstexprprivate
See also
doc/VU-LED-mapping.ods

Definition at line 27 of file VULEDs.hpp.

◆ mode

DotBarMode mode
privateinherited

Definition at line 75 of file DotBarDisplayLEDs.hpp.

◆ ledPins

template<uint16_t N>
const PinList<N> ledPins
privateinherited

Definition at line 83 of file LEDs.hpp.


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