Interface for LED control functionality.
More...
#include <i_led_controller.h>
|
| virtual | ~ILEDController ()=default |
| |
| virtual void | setup (uint32_t initialState=0)=0 |
| |
| virtual void | setState (bool state)=0 |
| |
| virtual void | toggle ()=0 |
| |
| virtual void | startBlink (uint32_t intervalMs, int16_t count=-1)=0 |
| | Start a blink sequence.
|
| |
| virtual void | stopBlink ()=0 |
| | Stop any running blink and restore the pre-blink state.
|
| |
| virtual void | update (uint32_t now)=0 |
| | Drive timed behaviour — must be called every loop iteration.
|
| |
| virtual bool | isBlinking () const =0 |
| | Returns true if a blink sequence is currently running.
|
| |
Interface for LED control functionality.
Supports both immediate state changes and non-blocking blink sequences. Call update() every loop iteration to drive timed behaviour.
Definition at line 11 of file i_led_controller.h.
◆ ~ILEDController()
| virtual ILEDController::~ILEDController |
( |
| ) |
|
|
virtualdefault |
◆ isBlinking()
| virtual bool ILEDController::isBlinking |
( |
| ) |
const |
|
pure virtual |
◆ setState()
| virtual void ILEDController::setState |
( |
bool |
state | ) |
|
|
pure virtual |
◆ setup()
| virtual void ILEDController::setup |
( |
uint32_t |
initialState = 0 | ) |
|
|
pure virtual |
◆ startBlink()
| virtual void ILEDController::startBlink |
( |
uint32_t |
intervalMs, |
|
|
int16_t |
count = -1 |
|
) |
| |
|
pure virtual |
Start a blink sequence.
- Parameters
-
| intervalMs | Half-period in ms (LED on for intervalMs, off for intervalMs) |
| count | Number of on/off cycles; -1 = blink indefinitely until stopBlink() |
Implemented in LEDController, and LEDController.
◆ stopBlink()
| virtual void ILEDController::stopBlink |
( |
| ) |
|
|
pure virtual |
◆ toggle()
| virtual void ILEDController::toggle |
( |
| ) |
|
|
pure virtual |
◆ update()
| virtual void ILEDController::update |
( |
uint32_t |
now | ) |
|
|
pure virtual |
Drive timed behaviour — must be called every loop iteration.
- Parameters
-
| now | Current time in milliseconds (e.g. millis()) |
Implemented in LEDController, and LEDController.
The documentation for this class was generated from the following file: