SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
|
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 |
A base class for LED blinker classes.
Definition at line 15 of file led_blinker.h.
sensesp::BaseBlinker::BaseBlinker | ( | int | pin | ) |
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.
void sensesp::BaseBlinker::flip_state | ( | ) |
Invert the current LED state.
Definition at line 29 of file led_blinker.cpp.
void sensesp::BaseBlinker::set_enabled | ( | bool | state | ) |
Enable or disable the blinker.
Definition at line 70 of file led_blinker.cpp.
void sensesp::BaseBlinker::set_state | ( | bool | state | ) |
Turn the LED on or off.
Definition at line 20 of file led_blinker.cpp.
|
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.
|
protected |
Definition at line 30 of file led_blinker.h.
|
protected |
Definition at line 33 of file led_blinker.h.
|
protected |
Definition at line 29 of file led_blinker.h.
|
protected |
Definition at line 31 of file led_blinker.h.
|
protected |
Definition at line 32 of file led_blinker.h.