SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::BaseBlinker Class Referenceabstract

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

#include <sensesp/system/led_blinker.h>

Inheritance diagram for sensesp::BaseBlinker:
[legend]

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 15 of file led_blinker.h.

Constructor & Destructor Documentation

◆ BaseBlinker()

sensesp::BaseBlinker::BaseBlinker ( int pin)

Definition at line 12 of file led_blinker.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ blip()

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

Flip the LED off and on for duration milliseconds.

Definition at line 34 of file led_blinker.cpp.

Here is the call graph for this function:

◆ flip_state()

void sensesp::BaseBlinker::flip_state ( )

Invert the current LED state.

Definition at line 29 of file led_blinker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_enabled()

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

Enable or disable the blinker.

Definition at line 70 of file led_blinker.cpp.

Here is the call graph for this function:

◆ set_state()

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

Turn the LED on or off.

Definition at line 20 of file led_blinker.cpp.

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.

Implemented in sensesp::EvenBlinker, sensesp::PatternBlinker, and sensesp::RatioBlinker.

Here is the caller graph for this function:

Member Data Documentation

◆ enabled_

bool sensesp::BaseBlinker::enabled_ = true
protected

Definition at line 30 of file led_blinker.h.

◆ event_

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

Definition at line 33 of file led_blinker.h.

◆ pin_

int sensesp::BaseBlinker::pin_
protected

Definition at line 29 of file led_blinker.h.

◆ state_

bool sensesp::BaseBlinker::state_ = false
protected

Definition at line 31 of file led_blinker.h.

◆ update_counter_

int sensesp::BaseBlinker::update_counter_ = 0
protected

Definition at line 32 of file led_blinker.h.


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