Loading [MathJax]/jax/output/HTML-CSS/config.js
SensESP 3.1.0
Universal Signal K sensor toolkit ESP32
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sensesp::BaseBlinker Class Referenceabstract

A base class for LED blinker classes. More...

#include <sensesp/system/led_blinker.h>

Public Member Functions

 BaseBlinker (int pin)
 
void set_state (bool state)
 
void flip_state ()
 
void blip (int duration=20)
 
void set_enabled (bool state)
 
virtual void tick ()=0
 

Protected Attributes

int pin_
 
bool enabled_ = true
 
bool state_ = false
 
int update_counter_ = 0
 
reactesp::Event * event_ = NULL
 

Detailed Description

A base class for LED blinker classes.

Definition at line 18 of file led_blinker.h.

Constructor & Destructor Documentation

◆ BaseBlinker()

sensesp::BaseBlinker::BaseBlinker ( int pin)
inline

Definition at line 20 of file led_blinker.h.

Here is the call graph for this function:

Member Function Documentation

◆ blip()

void sensesp::BaseBlinker::blip ( int duration = 20)
inline

Flip the LED off and on for duration milliseconds.

Definition at line 41 of file led_blinker.h.

Here is the call graph for this function:

◆ flip_state()

void sensesp::BaseBlinker::flip_state ( )
inline

Invert the current LED state.

Definition at line 36 of file led_blinker.h.

Here is the call graph for this function:

◆ set_enabled()

void sensesp::BaseBlinker::set_enabled ( bool state)
inline

Enable or disable the blinker.

Definition at line 76 of file led_blinker.h.

Here is the call graph for this function:

◆ set_state()

void sensesp::BaseBlinker::set_state ( bool state)
inline

Turn the LED on or off.

Definition at line 27 of file led_blinker.h.

Here is the caller graph for this function:

◆ tick()

virtual void sensesp::BaseBlinker::tick ( )
pure virtual

Tick is called whenever the blinker is enabled or when it's time to change the LED state.

Here is the caller graph for this function:

Member Data Documentation

◆ enabled_

bool sensesp::BaseBlinker::enabled_ = true
protected

Definition at line 96 of file led_blinker.h.

◆ event_

reactesp::Event* sensesp::BaseBlinker::event_ = NULL
protected

Definition at line 99 of file led_blinker.h.

◆ pin_

int sensesp::BaseBlinker::pin_
protected

Definition at line 95 of file led_blinker.h.

◆ state_

bool sensesp::BaseBlinker::state_ = false
protected

Definition at line 97 of file led_blinker.h.

◆ update_counter_

int sensesp::BaseBlinker::update_counter_ = 0
protected

Definition at line 98 of file led_blinker.h.


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