-
Notifications
You must be signed in to change notification settings - Fork 0
/
sketch.ino
241 lines (215 loc) · 5.55 KB
/
sketch.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#include <NeoPixelBus.h>
const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure
const uint8_t PixelPin = 2; // make sure to set this to the correct pin, ignored for Esp8266
#define colorSaturation 255
// three element pixels, in different order and speeds
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);
//NeoPixelBus<NeoRgbFeature, Neo400KbpsMethod> strip(PixelCount, PixelPin);
RgbColor red(colorSaturation, 0, 0);
RgbColor green(0, colorSaturation, 0);
RgbColor blue(0, 0, colorSaturation);
RgbColor white(colorSaturation);
RgbColor black(0);
//yellow
RgbColor yellow0(255,215,0);
RgbColor yellow1(200,160,0);
RgbColor yellow2(98,80,0);
RgbColor yellow3(60,50,0);
RgbColor yellow4(20,20,0);
RgbColor yellow5(10,10,0);
RgbColor yellow6(5,5,0);
RgbColor yellow7(2,2,0);
//orange
RgbColor orange0(255,60,0);
RgbColor orange1(210,48,0);
RgbColor orange2(112,31,0);
RgbColor orange3(58,19,0);
RgbColor orange4(28,8,0);
RgbColor orange5(20,5,0);
RgbColor orange6(10,2,0);
RgbColor orange7(8,2,0);
//TODO mint green/pink
//cyan
RgbColor cyan0(0,250,210);
RgbColor cyan1(0,195,155);
RgbColor cyan2(0,96,77);
RgbColor cyan3(0,58,47);
RgbColor cyan4(0,20,20);
RgbColor cyan5(0,10,10);
RgbColor cyan6(0,5,5);
RgbColor cyan7(0,2,2);
RgbColor r0(255,00,0);
RgbColor r1(150,00,0);
RgbColor r2(100,00,0);
RgbColor r3(63,00,0);
RgbColor r4(20,00,0);
RgbColor r5(8,00,0);
RgbColor r6(4,00,0);
RgbColor r7(2,00,0);
HslColor hslRed(red);
HslColor hslGreen(green);
HslColor hslBlue(blue);
HslColor hslWhite(white);
HslColor hslBlack(black);
void setup()
{
Serial.begin(115200);
strip.Begin();
strip.Show();
}
void loop()
{
strip.SetPixelColor(0, yellow0);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow1);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow2);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow3);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow4);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow5);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow6);
delay(1000);
strip.Show();
strip.SetPixelColor(0, yellow7);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange0);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange1);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange2);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange3);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange4);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange5);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange6);
delay(1000);
strip.Show();
strip.SetPixelColor(0, orange7);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan0);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan1);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan2);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan3);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan4);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan5);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan6);
delay(1000);
strip.Show();
strip.SetPixelColor(0, cyan7);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r0);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r1);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r2);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r3);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r4);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r5);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r6);
delay(1000);
strip.Show();
strip.SetPixelColor(0, r7);
delay(1000);
strip.Show();
delay(1000);
//Test brightness of colors relative to each other (e.g. yellow vs. orange)
strip.SetPixelColor(0, yellow0);
strip.SetPixelColor(1, orange0);
strip.SetPixelColor(2, cyan0);
strip.SetPixelColor(3, r0);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow1);
strip.SetPixelColor(1, orange1);
strip.SetPixelColor(2, cyan1);
strip.SetPixelColor(3, r1);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow2);
strip.SetPixelColor(1, orange2);
strip.SetPixelColor(2, cyan2);
strip.SetPixelColor(3, r2);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow3);
strip.SetPixelColor(1, orange3);
strip.SetPixelColor(2, cyan3);
strip.SetPixelColor(3, r3);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow4);
strip.SetPixelColor(1, orange4);
strip.SetPixelColor(2, cyan4);
strip.SetPixelColor(3, r4);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow5);
strip.SetPixelColor(1, orange5);
strip.SetPixelColor(2, cyan5);
strip.SetPixelColor(3, r5);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow6);
strip.SetPixelColor(1, orange6);
strip.SetPixelColor(2, cyan6);
strip.SetPixelColor(3, r6);
delay(10000);
strip.Show();
strip.SetPixelColor(0, yellow7);
strip.SetPixelColor(1, orange7);
strip.SetPixelColor(2, cyan7);
strip.SetPixelColor(3, r7);
delay(10000);
strip.Show();
delay(10000);
strip.SetPixelColor(0, hslBlack);
strip.SetPixelColor(1, hslBlack);
strip.SetPixelColor(2, hslBlack);
strip.SetPixelColor(3, hslBlack);
strip.Show();
delay(1000);
}