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
LEDs< N > Class Template Reference

A class for collections of LEDs that can display ranges. More...

#include <LEDs.hpp>

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

Public Member Functions

 LEDs (const PinList< N > &ledPins)
 Create a LEDs object. 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 displayDot (uint8_t led) const
 Turn on a single LED, and turn off all others. More...
 
void clear () const
 Turn off all LEDs. More...
 

Private Attributes

const PinList< N > ledPins
 

Detailed Description

template<uint8_t N>
class LEDs< N >

A class for collections of LEDs that can display ranges.

Template Parameters
NThe number of LEDs in the collection.

Definition at line 19 of file LEDs.hpp.

Constructor & Destructor Documentation

◆ LEDs()

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

Create a LEDs object.

Parameters
ledPinsAn array of pins with the LEDs connected.

Definition at line 27 of file LEDs.hpp.

Member Function Documentation

◆ begin()

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

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
inline

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
inline

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
inline

Turn off the given LED.

Definition at line 62 of file LEDs.hpp.

◆ displayDot()

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

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

Parameters
ledThe LED to turn on.

Definition at line 73 of file LEDs.hpp.

◆ clear() [2/2]

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

Turn off all LEDs.

Definition at line 78 of file LEDs.hpp.

Member Data Documentation

◆ ledPins

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

Definition at line 84 of file LEDs.hpp.


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