WS2812 RMT Driver
API reference
Loading...
Searching...
No Matches
ws2812_effects.hpp
Go to the documentation of this file.
1
6#pragma once
7#include "ws2812_cpp.hpp"
8
9#ifdef __cplusplus
10
18public:
20
21 explicit WS2812Animator(WS2812Strip& strip, uint32_t virtual_length = 0);
22
29 void SetEffect(Effect effect, uint32_t color = 0xFFFFFF);
30
32 void SetVirtualLength(uint32_t length);
33
35 void SetStep(uint16_t step);
36 uint16_t Step() const;
37
41 void Tick();
42
43private:
44 WS2812Strip& strip_;
45 bool initialized_ = false;
46 uint32_t virtual_length_ = 0;
47 Effect effect_ = Effect::Off;
48 uint32_t color_ = 0xFFFFFF;
49 uint16_t step_ = 0;
50 int dir_ = 1;
51 uint8_t brightness_ = 0;
52};
53
54#endif // __cplusplus
Helper class implementing a few basic WS2812 LED animations.
Definition ws2812_effects.hpp:17
void SetStep(uint16_t step)
Definition ws2812_effects.cpp:27
void SetVirtualLength(uint32_t length)
Definition ws2812_effects.cpp:23
void Tick()
Advance the animation by one step.
Definition ws2812_effects.cpp:35
void SetEffect(Effect effect, uint32_t color=0xFFFFFF)
Select the active effect.
Definition ws2812_effects.cpp:15
Effect
Definition ws2812_effects.hpp:19
uint16_t Step() const
Definition ws2812_effects.cpp:31
C++ convenience wrapper for a chain of WS2812 LEDs.
Definition ws2812_cpp.hpp:26
C++ wrapper for the HF-WS2812 RMT LED driver.