RSeries astromech firmware
SingleStatusLED< DATA_PIN > Class Template Reference

#include <core/SingleStatusLED.h>

Detailed Description

template<uint8_t DATA_PIN>
class SingleStatusLED< DATA_PIN >

LED status indicator.

Animate a single LED status indicator

StatusLED statusLED;
+ Inheritance diagram for SingleStatusLED< DATA_PIN >:
+ Collaboration diagram for SingleStatusLED< DATA_PIN >:

Public Member Functions

 SingleStatusLED ()
 
 SingleStatusLED (const uint8_t(*colors)[4][3], unsigned numModes=1)
 
virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
virtual void animate () override
 Subclasses must implement this function to run through a single frame of animation/activity. More...
 
void setMode (unsigned mode)
 
void setDelay (uint32_t delay)
 
- Public Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 
- Public Member Functions inherited from SetupEvent
 SetupEvent ()
 Default Constructor. More...
 

Protected Member Functions

void pickColor ()
 

Protected Attributes

FastLEDPCB< WS2812B, DATA_PIN > fStatus
 
byte fStatusColor = 0
 
byte fPrevStatusColor = 0
 
unsigned fMode = 0
 
unsigned fNumModes = 4
 
const uint8_t(* fColors )[4][3] = nullptr
 
uint32_t fPrevFlipFlopMillis = 0
 
uint32_t fStatusFlipFlopTime = 1000
 

Additional Inherited Members

- Static Public Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 
- Static Public Member Functions inherited from SetupEvent
static void ready ()
 Calls setup() for each created AnimatedEvent subclass. More...
 

Constructor & Destructor Documentation

◆ SingleStatusLED() [1/2]

template<uint8_t DATA_PIN>
SingleStatusLED< DATA_PIN >::SingleStatusLED ( )
inline

◆ SingleStatusLED() [2/2]

template<uint8_t DATA_PIN>
SingleStatusLED< DATA_PIN >::SingleStatusLED ( const uint8_t(*)  colors[4][3],
unsigned  numModes = 1 
)
inline

Member Function Documentation

◆ animate()

template<uint8_t DATA_PIN>
virtual void SingleStatusLED< DATA_PIN >::animate ( )
inlineoverridevirtual

Subclasses must implement this function to run through a single frame of animation/activity.

Subclasses should not call delay() or otherwise block.

Implements AnimatedEvent.

◆ pickColor()

template<uint8_t DATA_PIN>
void SingleStatusLED< DATA_PIN >::pickColor ( )
inlineprotected

◆ setDelay()

template<uint8_t DATA_PIN>
void SingleStatusLED< DATA_PIN >::setDelay ( uint32_t  delay)
inline

◆ setMode()

template<uint8_t DATA_PIN>
void SingleStatusLED< DATA_PIN >::setMode ( unsigned  mode)
inline

◆ setup()

template<uint8_t DATA_PIN>
virtual void SingleStatusLED< DATA_PIN >::setup ( )
inlineoverridevirtual

Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor.

Implements SetupEvent.

Member Data Documentation

◆ fColors

template<uint8_t DATA_PIN>
const uint8_t(* SingleStatusLED< DATA_PIN >::fColors)[4][3] = nullptr
protected

◆ fMode

template<uint8_t DATA_PIN>
unsigned SingleStatusLED< DATA_PIN >::fMode = 0
protected

◆ fNumModes

template<uint8_t DATA_PIN>
unsigned SingleStatusLED< DATA_PIN >::fNumModes = 4
protected

◆ fPrevFlipFlopMillis

template<uint8_t DATA_PIN>
uint32_t SingleStatusLED< DATA_PIN >::fPrevFlipFlopMillis = 0
protected

◆ fPrevStatusColor

template<uint8_t DATA_PIN>
byte SingleStatusLED< DATA_PIN >::fPrevStatusColor = 0
protected

◆ fStatus

template<uint8_t DATA_PIN>
FastLEDPCB<WS2812B, DATA_PIN> SingleStatusLED< DATA_PIN >::fStatus
protected

◆ fStatusColor

template<uint8_t DATA_PIN>
byte SingleStatusLED< DATA_PIN >::fStatusColor = 0
protected

◆ fStatusFlipFlopTime

template<uint8_t DATA_PIN>
uint32_t SingleStatusLED< DATA_PIN >::fStatusFlipFlopTime = 1000
protected

The documentation for this class was generated from the following file:
SingleStatusLED
LED status indicator.
Definition: SingleStatusLED.h:22