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

simulate a flickering light like a fire More...

#include <Noiasca_led.h>

Inherits LedBase< T >.

Public Member Functions

 Flicker (T &obj)
 simulate a flickering light like a fire More...
 
void off () override
 switch off
 
void setMaxBrightness (uint8_t _maxBrightness)
 set the maximum brightness 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 Flicker< T >

simulate a flickering light like a fire

state 0 off, 1 flicker_on

Constructor & Destructor Documentation

◆ Flicker()

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

simulate a flickering light like a fire

Parameters
objthe pin to connect

Member Function Documentation

◆ setMaxBrightness()

template<class T >
void Flicker< T >::setMaxBrightness ( uint8_t  _maxBrightness)
inline

set the maximum brightness

The output will dimm up to this maximum level.

Parameters
_maxBrightnessthe maximum brigthness (upper end of range) [0..255]

◆ update()

template<class T >
void Flicker< 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