Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Neopixel
- {
- public:
- Neopixel(int size);
- Neopixel(const Neopixel&) = default;
- Neopixel& operator =(const Neopixel&) = default;
- Neopixel(Neopixel&&) = default;
- Neopixel& operator =(Neopixel&&) = default;
- virtual ~Neopixel();
- void shine_everyone(Color val);
- void rotate_left(std::vector<Color> colors);
- void rotate_right(std::vector<Color> colors);
- void run_n_back(std::vector<Color> colors);
- void darkness(Color color, double bright);
- void brightness(Color color, double bright);
- void every_second(Color color);
- private:
- enum class Mode
- {
- UP, DOWN
- };
- constexpr static uint32_t CODE_0{0x7C00}; // RGB and GRB
- constexpr static uint32_t CODE_1{0x7F80}; //RGB 7F80- for GRB try 0x7FF0[? maybe it's not necessery to change it in dependend on RGB/GRB. Probalby it's enough to change R and G.]
- std::vector<Color> values;
- Mode mode;
- uint16_t LED_data;
- auto create_vec_levels(Color color, double bright);
- void send();
- bool get_bit(uint32_t k, uint32_t n) {
- return (k & (1 << (n)));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement