Control Surface  1.1.1
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 <AH/Hardware/LEDs/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 AH::LEDs< N >

A class for collections of LEDs that can display ranges.

Template Parameters
NThe number of LEDs in the collection.

Definition at line 21 of file LEDs.hpp.

Constructor & Destructor Documentation

◆ LEDs()

LEDs ( const PinList< N > &  ledPins)
inline

Create a LEDs object.

Parameters
ledPinsAn array of pins with the LEDs connected.

Definition at line 29 of file LEDs.hpp.

Member Function Documentation

◆ begin()

void begin ( ) const
inline

Initialize (set LED pins as outputs).

Definition at line 34 of file LEDs.hpp.

◆ displayRange()

void 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 48 of file LEDs.hpp.

◆ set()

void set ( uint8_t  index) const
inline

Turn on the given LED.

Definition at line 58 of file LEDs.hpp.

◆ clear() [1/2]

void clear ( uint8_t  index) const
inline

Turn off the given LED.

Definition at line 64 of file LEDs.hpp.

◆ displayDot()

void 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 75 of file LEDs.hpp.

◆ clear() [2/2]

void clear ( ) const
inline

Turn off all LEDs.

Definition at line 80 of file LEDs.hpp.

Member Data Documentation

◆ ledPins

const PinList<N> ledPins
private

Definition at line 86 of file LEDs.hpp.


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