SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::PatternBlinker Class Reference

A blinker that blinks the LED according to a defined repeating pattern. More...

#include <sensesp/system/led_blinker.h>

Inheritance diagram for sensesp::PatternBlinker:
[legend]

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)
 
void start () override
 
- Public Member Functions inherited from sensesp::Startable
 Startable (int priority=0)
 
const int get_start_priority ()
 
void set_start_priority (int priority)
 

Protected Attributes

intpattern_
 
unsigned int pattern_ptr_ = 0
 
- Protected Attributes inherited from sensesp::BaseBlinker
int pin_
 
bool enabled_ = true
 
bool state_ = false
 
int update_counter_ = 0
 
Reactionreaction_ = NULL
 

Additional Inherited Members

- Static Public Member Functions inherited from sensesp::Startable
static void start_all ()
 

Detailed Description

A blinker that blinks the LED according to a defined repeating pattern.

Definition at line 78 of file led_blinker.h.

Constructor & Destructor Documentation

◆ PatternBlinker()

sensesp::PatternBlinker::PatternBlinker ( int  pin,
int  pattern[] 
)

Definition at line 108 of file led_blinker.cpp.

Member Function Documentation

◆ restart()

void sensesp::PatternBlinker::restart ( )

Definition at line 138 of file led_blinker.cpp.

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

◆ set_pattern()

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 117 of file led_blinker.cpp.

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

◆ tick()

void sensesp::PatternBlinker::tick ( )
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 122 of file led_blinker.cpp.

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

Member Data Documentation

◆ pattern_

int* sensesp::PatternBlinker::pattern_
protected

Definition at line 86 of file led_blinker.h.

◆ pattern_ptr_

unsigned int sensesp::PatternBlinker::pattern_ptr_ = 0
protected

Definition at line 87 of file led_blinker.h.


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