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

A periodic blinker that defines both the on-ratio and the period length. More...

#include <sensesp/system/led_blinker.h>

Inheritance diagram for sensesp::RatioBlinker:
[legend]

Public Member Functions

 RatioBlinker (int pin, unsigned int period, float ratio=0.)
 
void tick () override final
 
void set_ratio (unsigned int ratio)
 
- Public Member Functions inherited from sensesp::PeriodicBlinker
 PeriodicBlinker (int pin, unsigned int period)
 
void set_period (unsigned int period)
 
- 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

float ratio_
 
- Protected Attributes inherited from sensesp::PeriodicBlinker
unsigned int period_
 
- 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 periodic blinker that defines both the on-ratio and the period length.

Definition at line 64 of file led_blinker.h.

Constructor & Destructor Documentation

◆ RatioBlinker()

sensesp::RatioBlinker::RatioBlinker ( int  pin,
unsigned int  period,
float  ratio = 0. 
)

Definition at line 94 of file led_blinker.cpp.

Member Function Documentation

◆ set_ratio()

void sensesp::RatioBlinker::set_ratio ( unsigned int  ratio)
inline

Definition at line 68 of file led_blinker.h.

◆ tick()

void sensesp::RatioBlinker::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 97 of file led_blinker.cpp.

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

Member Data Documentation

◆ ratio_

float sensesp::RatioBlinker::ratio_
protected

Definition at line 71 of file led_blinker.h.


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