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

#include <AH/Hardware/LEDs/LEDs.hpp>

Detailed Description

template<uint16_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 18 of file LEDs.hpp.

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

Public Member Functions

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

Private Attributes

const PinList< N > ledPins
 

Constructor & Destructor Documentation

◆ LEDs()

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

Create a LEDs object.

Parameters
ledPinsAn array of pins with the LEDs connected.

Definition at line 26 of file LEDs.hpp.

Member Function Documentation

◆ begin()

template<uint16_t N>
void begin ( ) const
inline

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

◆ set()

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

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
inline

Turn off the given LED.

Definition at line 61 of file LEDs.hpp.

◆ displayDot()

template<uint16_t N>
void displayDot ( uint16_t led) const
inline

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

Parameters
ledThe LED to turn on.

Definition at line 72 of file LEDs.hpp.

◆ clear() [2/2]

template<uint16_t N>
void clear ( ) const
inline

Turn off all LEDs.

Definition at line 77 of file LEDs.hpp.

Member Data Documentation

◆ ledPins

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

Definition at line 83 of file LEDs.hpp.


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