Noiasca Tool Kit
Several helper functions and classes to make life with Arduino easier
Public Member Functions | List of all members
Bounce5< T > Class Template Reference

Bounce 5 LEDs between left and right. More...

#include <Noiasca_led.h>

Public Member Functions

 Bounce5 (T &obj)
 Bounce 5 LEDs between left and right. More...
 
void begin ()
 start hardware More...
 
void setOnStateChange (Callback funcPtr)
 set the callback function onStateChange More...
 
void on ()
 switch output on More...
 
void off ()
 switch output off More...
 
void toggle ()
 switch between on or off state
 
void update (uint32_t currentMillis=millis())
 check if update is necessary More...
 

Detailed Description

template<class T>
class Bounce5< T >

Bounce 5 LEDs between left and right.

running lights like a KITT/Larson Scanner states are: 0 off; 1 run and on, 2 run but off

doesn't inherit from LedBase

Constructor & Destructor Documentation

◆ Bounce5()

template<class T >
Bounce5< T >::Bounce5 ( T &  obj)
inline

Bounce 5 LEDs between left and right.

Parameters
obja object with 5 LEDs

Member Function Documentation

◆ begin()

template<class T >
void Bounce5< T >::begin ( )
inline

start hardware

Will do the necessary steps to initialize the hardware pins. Call this function in your setup().

◆ setOnStateChange()

template<class T >
void Bounce5< T >::setOnStateChange ( Callback  funcPtr)
inline

set the callback function onStateChange

a callback function receives state changes from the car traffic light

Parameters
funcPtrthe callback function
Todo:
clearify usage of this vs onSequnceChange

◆ on()

template<class T >
void Bounce5< T >::on ( )
inline

switch output on

Switch the output to on state.

◆ off()

template<class T >
void Bounce5< T >::off ( )
inline

switch output off

Switch the output to off state.

◆ update()

template<class T >
void Bounce5< T >::update ( uint32_t  currentMillis = millis())
inline

check if update is necessary

This is the "run" function. Call this function in loop() to make the effect visible.

Parameters
currentMillisyou can handover a millis timestamp