HF-WS2812 Driver 0.1.0-dev
HF-WS2812 ESP32 RMT Driver
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
17class WS2812Animator {
18public:
19 enum class Effect { Off, SolidColor, Rainbow, Chase, Blink, Breath, Larson };
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
C++ wrapper for the HF-WS2812 RMT LED driver.