-
Notifications
You must be signed in to change notification settings - Fork 0
/
Effect.hpp
47 lines (37 loc) · 1.15 KB
/
Effect.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _EFFECT_HPP
#define _EFFECT_HPP
#include <stdint.h>
#include <string.h>
struct Effect
{
Effect(uint16_t slave);
uint16_t slave_id;
uint8_t id;
uint32_t start_time;
uint32_t duration;
long dt;
long prev_dt;
int my_rand;
uint8_t noise[32];
void init(uint8_t* buff);
void start(uint8_t id, uint32_t duration);
void execute(void);
void all_stop(uint8_t* buff);
void reset();
uint8_t get_delay(const uint8_t lut[], size_t len);
enum State
{
stopped, pending, running
} state;
// slave/effect specific delay, indexed by effect number
static const unsigned max_effect = 21;
void flash_id(); // Blinks slave id
void pulse(); // Fast on white 50%, fades for duration
void white_sparkle(); // each slave flashes randomly at 50%
void group_1_on(); // Fast on white 50%, stays on for duration
void group_2_on(); // Fast on white 50%, stays on for duration
void group_2_white_sparkle(); // flash randomly (each slave differently)
void group_3_on(); // Fast on white 50%, stays on for duration
void group_3_white_sparkle(); // flash randomly (each slave differently)
};
#endif