Let physical LEDs burn, blink or blink once.
More...
#include <leds.h>
|
| Leds (BelaContext *ctx) |
| Initialize LED controller and state machine. More...
|
|
void | setState (Led led, LedState ledstate, float period=LED_HOLD_TIME, float dutycycle=0.5) |
| Set a certain LED in a certain state. The state blink_once will - after it has blinked - automatically go back to state off. Note that setState does nothing in case the led is already in the state that setState wants it to set. More...
|
|
LedState | getState (Led led) const |
| Get the current led state. More...
|
|
void | processBuf (BelaContext *ctx) |
| Run this function in render. More...
|
|
void | processFrame (BelaContext *ctx, us frame) |
|
Let physical LEDs burn, blink or blink once.
Definition at line 15 of file leds.h.
◆ Led
Led enumeration.
Enumerator |
---|
wrist | Led on wrist.
|
thumb | Led on thumb.
|
vibrator | The vibrator, which is not really an LED but can be controlled the same way.
|
controlbox | Control box led.
|
Definition at line 22 of file leds.h.
◆ LedState
A state in which a certain LED can be set.
Enumerator |
---|
off | No light.
|
on | Burn permanently.
|
blink_permanent | Blink all the time.
|
blink_once | Blink once.
|
Definition at line 44 of file leds.h.
◆ Leds()
Leds::Leds |
( |
BelaContext * |
ctx | ) |
|
Initialize LED controller and state machine.
- Parameters
-
Definition at line 6 of file leds.cpp.
◆ getState()
Get the current led state.
- Parameters
-
- Returns
- Its state
Definition at line 91 of file leds.h.
◆ processBuf()
void Leds::processBuf |
( |
BelaContext * |
ctx | ) |
|
Run this function in render.
- Parameters
-
Definition at line 57 of file leds.cpp.
◆ processFrame()
void Leds::processFrame |
( |
BelaContext * |
ctx, |
|
|
us |
frame |
|
) |
| |
◆ setState()
Set a certain LED in a certain state. The state blink_once will - after it has blinked - automatically go back to state off. Note that setState does nothing in case the led is already in the state that setState wants it to set.
- Parameters
-
led | The led to set |
ledstate | The state to set the state in. |
period | The period, in seconds in case of blink_permanent (total time of a cycle), in case of blink_once, the time that it should be on. |
dutycycle | In case of blink_permanent, the time that it is on. |
Definition at line 79 of file leds.cpp.
The documentation for this class was generated from the following files: