|
WS2812 RMT Driver
API reference
|
Helper class implementing a few basic WS2812 LED animations. More...
#include <ws2812_effects.hpp>
Public Types | |
| enum class | Effect { Off , SolidColor , Rainbow , Chase , Blink , Breath , Larson } |
Public Member Functions | |
| WS2812Animator (WS2812Strip &strip, uint32_t virtual_length=0) | |
| void | SetEffect (Effect effect, uint32_t color=0xFFFFFF) |
| Select the active effect. | |
| void | SetVirtualLength (uint32_t length) |
| void | SetStep (uint16_t step) |
| uint16_t | Step () const |
| void | Tick () |
| Advance the animation by one step. | |
Helper class implementing a few basic WS2812 LED animations.
Call tick() periodically (for example from a FreeRTOS task) to update the currently selected effect.
|
strong |
|
explicit |
| void WS2812Animator::SetEffect | ( | Effect | effect, |
| uint32_t | color = 0xFFFFFF |
||
| ) |
Select the active effect.
| effect | Desired pattern. |
| color | Base colour used by some effects. |
| void WS2812Animator::SetStep | ( | uint16_t | step | ) |
Set the current step (used for external synchronization).
| void WS2812Animator::SetVirtualLength | ( | uint32_t | length | ) |
Adjust the virtual length used for effects.
| uint16_t WS2812Animator::Step | ( | ) | const |
| void WS2812Animator::Tick | ( | ) |
Advance the animation by one step.