-
Notifications
You must be signed in to change notification settings - Fork 6
/
xmas_neopixel_lite.ino
100 lines (90 loc) · 2.64 KB
/
xmas_neopixel_lite.ino
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "neopixel.h"
#include "clrutils.h"
#include "animation.h"
#include "clean.h"
#include "manager.h"
const uint8_t NEO_BRGHT = 255;
const uint8_t NEO_PIN = 6; // Pin of Neopixel Strip
const uint16_t StripSize = 100; // Length of Neopixel Strip
NEOPIXEL strip = NEOPIXEL(StripSize, NEO_PIN, NEO_RGB + NEO_KHZ800);
colorWipe cWipe;
colorWalk cWalk;
randomCreep cCreep;
rainbow cRainbow;
rainCycle cRainCycle;
rainFull cRainFull;
colorWave cWave;
lightUp lUp;
sparks sRnd;
rndFade rFade;
centerRun cRun;
shineSeven cSeven;
walkSeven wSeven;
flashSeven fSeven;
shineFlash cFlash;
mergeOne mOne;
mergeWave mWave;
collideOne cOne;
neoFire cFire;
evenOdd cEvenOdd;
collMdl cCollMdl;
collEnd cCollEnd;
rainBlend cBlend;
swing cSwing;
swingSingle cSwingS;
randomFill rFill;
singleWave sWave;
worms cWorms;
interfer cInterf;
toward cToward;
towardRain rToward;
lghtHouse lHouse;
rndDrops cDrops;
solCreep sCreep;
//theatChase tChase;
//meteorSky mtrSky;
symmRun symRun;
//metSingle mtrSgl;
//pureStrip pStrip;
//sideFill sFill;
//browMotion cBrowian;
//rainDrops cRainDrp;
ripeFruit cRipe;
//brightWave bWave;
//brColCreep bcCreep;
clearSide clrSide;
clearCntr clrCntr;
clearFade clrFade;
eatCntr clrEat;
clearHalf clrHalf;
animation* anims[] = {
&cWipe, &cWalk, &cCreep, &cRainbow, &cRainCycle, &cRainFull, &cWave, &lUp, &sRnd, &rFade,
&cCollEnd, &cRun, &cSeven, &mOne, &mWave, &cOne, &cFire, &cEvenOdd, &rFill, &cCollMdl,
&cBlend, &cSwing, &cSwingS, &cFlash, &sWave, &cWorms, &cInterf, &cToward, &rToward, &lHouse,
&cDrops, &wSeven, &fSeven, &sCreep, &symRun, &cRipe
};
clr* clearance[] = { &clrSide, &clrCntr, &clrFade, &clrEat, &clrHalf };
const byte num_anim = sizeof(anims) / sizeof(animation*);
const byte num_clr = sizeof(clearance) / sizeof(clr*);
MANAGER mgr(anims, num_anim, clearance, num_clr);
void setup() {
//Serial.begin(115200);
uint32_t rnd = 0;
for (byte i = A0; i < A4; ++i) {
pinMode(i, INPUT);
rnd <<= 6;
rnd += analogRead(i);
}
randomSeed(rnd);
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
strip.begin();
strip.setBrightness(NEO_BRGHT);
strip.show(); // Initialize all pixels to 'off'
mgr.init();
}
void loop() {
mgr.show();
}