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

heart beat - dims up and down permanentely More...

#include <Noiasca_led.h>

Inherits LedBase< T >.

Public Member Functions

 Heartbeat (T &obj)
 heart beat LED More...
 
uint16_t getCurrentBrightness ()
 get the current brightness More...
 
void setCurrentBrightness (uint8_t brightness)
 set the current brightness More...
 
void setMaxBrightness (uint8_t maxBrightness)
 set the maximum brightness More...
 
void setMinBrightness (uint8_t minBrightness)
 set the minium brightness More...
 
void on () override
 switch on
 
void off () override
 switch off
 
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 Heartbeat< T >

heart beat - dims up and down permanentely

The output will dimm up and down. You can define threashold for min and max dim level.

Constructor & Destructor Documentation

◆ Heartbeat()

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

heart beat LED

Parameters
obja obj representing a LED

Member Function Documentation

◆ getCurrentBrightness()

template<class T >
uint16_t Heartbeat< T >::getCurrentBrightness ( )
inline

get the current brightness

The current brightness/level of this output

Returns
the current brigthness

◆ setCurrentBrightness()

template<class T >
void Heartbeat< T >::setCurrentBrightness ( uint8_t  brightness)
inline

set the current brightness

Set a new current brightness/level of this output

Parameters
brightnessthe new current brigthness

◆ setMaxBrightness()

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

◆ setMinBrightness()

template<class T >
void Heartbeat< T >::setMinBrightness ( uint8_t  minBrightness)
inline

set the minium brightness

The output will dimm down to this minium level.

Parameters
minBrightnessthe minium brigthness (lower end of range) [0..255]

◆ update()

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