SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
|
A blinker that blinks the LED according to a defined repeating pattern. More...
#include <sensesp/system/led_blinker.h>
Public Member Functions | |
PatternBlinker (int pin, int pattern[]) | |
void | tick () override final |
void | set_pattern (int pattern[]) |
void | restart () |
Public Member Functions inherited from sensesp::BaseBlinker | |
BaseBlinker (int pin) | |
void | set_state (bool state) |
void | flip_state () |
void | blip (int duration=20) |
void | set_enabled (bool state) |
Protected Attributes | |
int * | pattern_ |
unsigned int | pattern_ptr_ = 0 |
Protected Attributes inherited from sensesp::BaseBlinker | |
int | pin_ |
bool | enabled_ = true |
bool | state_ = false |
int | update_counter_ = 0 |
reactesp::Event * | event_ = NULL |
A blinker that blinks the LED according to a defined repeating pattern.
Definition at line 76 of file led_blinker.h.
sensesp::PatternBlinker::PatternBlinker | ( | int | pin, |
int | pattern[] ) |
Definition at line 114 of file led_blinker.cpp.
void sensesp::PatternBlinker::restart | ( | ) |
Definition at line 144 of file led_blinker.cpp.
void sensesp::PatternBlinker::set_pattern | ( | int | pattern[] | ) |
Set a new blink pattern. Patterns are arrays of ints, with PATTERN_END as the last value. Each number in the pattern indicates the length of that segment, in milliseconds. The first number indicates an ON duration, the second an OFF duration, and so on.
Definition at line 123 of file led_blinker.cpp.
|
finaloverridevirtual |
Tick is called whenever the blinker is enabled or when it's time to change the LED state.
Implements sensesp::BaseBlinker.
Definition at line 128 of file led_blinker.cpp.
|
protected |
Definition at line 84 of file led_blinker.h.
|
protected |
Definition at line 85 of file led_blinker.h.