/
LEDStripShow.h
67 lines (51 loc) · 1.8 KB
/
LEDStripShow.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// ---------------------------------------------------------------------------
// CONFIGURATION ITEMS
// Number of LEDs on the LedStrip (required to size the LedStrip memory buffer)
// 26, 87, 160
#define _LED_COUNT_ 160
// Number of active effects (used to size the effect array)
#define _EFFECT_COUNT_ 12
// Time [ms] an effect is displayed until its cycles to the next
#define _CYCLE_TIME_ ((unsigned long)(30000))
// Time [ms] to wait after a setting change before the new settings are saved
#define _WAIT_SAVE_ ((unsigned long)(10000))
// ---------------------------------------------------------------------------
// Bit to indicate cycling mode
#define _MODE_CYCLER_ (0x01)
#define _EEPROM_OFFSET_ 4
#define _EEPROM_MARKER_ ((byte)(13))
#define _EEPROM_RECORD_MARKER_ ((byte)(13))
#define _EEPROM_RECORD_LENGTH_ 16
// ---------------------------------------------------------------------------
struct Effect_t {
LedEffect* pAppl;
int ParA;
int ParB;
};
// ---------------------------------------------------------------------------
class TLedStripShow {
private:
byte _mode;
byte _effectIx;
byte _buffer[_EEPROM_RECORD_LENGTH_];
TTimer TimerCycler;
TTimer TimerSaving;
public:
TLedStripShow() {};
void run();
void flash();
void enableCycling();
void disableCycling();
byte isCyclingEnabled();
void setMode(byte mode);
byte getMode();
byte setEffect(byte ix);
byte nextEffect();
byte getEffect();
void delayedSaving();
void savingDone();
void loadSettings(byte ix);
void saveSettings(byte ix);
void loadProgram();
void saveProgram();
};