Arduino Helpers master
Utility library for Arduino
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 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. 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 displayDot (uint16_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
 

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

Member Function Documentation

◆ begin()

void begin ( ) const
inline

Initialize (set LED pins as outputs).

Definition at line 31 of file LEDs.hpp.

◆ displayRange()

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()

void set ( uint16_t  index) const
inline

Turn on the given LED.

Definition at line 55 of file LEDs.hpp.

◆ clear() [1/2]

void clear ( uint16_t  index) const
inline

Turn off the given LED.

Definition at line 61 of file LEDs.hpp.

◆ displayDot()

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]

void clear ( ) const
inline

Turn off all LEDs.

Definition at line 77 of file LEDs.hpp.

Member Data Documentation

◆ ledPins

const PinList<N> ledPins
private

Definition at line 83 of file LEDs.hpp.


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