SensESP 2.7.2
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
 
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

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 base class for LED blinker classes.

Definition at line 16 of file led_blinker.h.

Constructor & Destructor Documentation

◆ BaseBlinker()

sensesp::BaseBlinker::BaseBlinker ( int  pin)

Definition at line 11 of file led_blinker.cpp.

Member Function Documentation

◆ blip()

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

Flip the LED off and on for duration milliseconds.

Definition at line 30 of file led_blinker.cpp.

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

◆ flip_state()

void sensesp::BaseBlinker::flip_state ( )

Invert the current LED state.

Definition at line 25 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 65 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 16 of file led_blinker.cpp.

Here is the caller graph for this function:

◆ start()

void sensesp::BaseBlinker::start ( )
overridevirtual

Called during the initialization process. Override this method to add runtime initialization code to your class

Reimplemented from sensesp::Startable.

Definition at line 78 of file led_blinker.cpp.

Here is the call 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::RatioBlinker, and sensesp::PatternBlinker.

Here is the caller graph for this function:

Member Data Documentation

◆ enabled_

bool sensesp::BaseBlinker::enabled_ = true
protected

Definition at line 32 of file led_blinker.h.

◆ pin_

int sensesp::BaseBlinker::pin_
protected

Definition at line 31 of file led_blinker.h.

◆ reaction_

Reaction* sensesp::BaseBlinker::reaction_ = NULL
protected

Definition at line 35 of file led_blinker.h.

◆ state_

bool sensesp::BaseBlinker::state_ = false
protected

Definition at line 33 of file led_blinker.h.

◆ update_counter_

int sensesp::BaseBlinker::update_counter_ = 0
protected

Definition at line 34 of file led_blinker.h.


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