FastLED 3.9.15
Loading...
Searching...
No Matches
funky.cpp
Go to the documentation of this file.
1/*
2TODO:
3
4 example show oscis+p
5 document caleidoscopes better
6 write better caleidoscopes...
7 improve and document emitters and oszillators
8 explaining one example step by step:
9 goal? what? how? why?
10 gridmapping for rotation + zoom
11 good interpolation for other matrix dimensions than 16*16
12 more move & stream functions
13 layers
14 palettes
15 link effects to areas
16 1D examples
17 2d example with more than 2 sines
18 speed up MSGEQ7 readings
19
20
21 DONE:
22 25.6. creating basic structure
23 setting up basic examples
24 26.6. MSGEQ7 Support
25 wrote more examples
26 27.6. improved documentation
27 added Move
28 added AutoRun
29 TODO list
30 Copy
31 29.6. rotate+mirror triangle
32 more examples
33 30.6. RenderCustomMatrix
34 added more comments
35 alpha version released
36
37
38/*
39
40/*
41 Funky Clouds Compendium (alpha version)
42 by Stefan Petrick
43
44 An ever growing list of examples, tools and toys
45 for creating one- and twodimensional LED effects.
46
47 Dedicated to the users of the FastLED v2.1 library
48 by Daniel Garcia and Mark Kriegsmann.
49
50 Provides basic and advanced helper functions.
51 Contains many examples how to creatively combine them.
52
53 Tested @ATmega2560 (runs propably NOT on an Uno or
54 anything else with less than 4kB RAM)
55 */
56
57#include "FastLED.h"
58
59#include "defs.h"
60#include "funky.h"
61#include "gfx.h"
62
63
64
65// your display buffer for your not 16*16 setup
67
68// the oscillators: linear ramps 0-255
69// modified only by MoveOscillators()
70byte osci[4];
71
72// sin8(osci) swinging between 0 - 15
73// modified only by MoveOscillators()
74byte p[4];
75
76// storage of the 7 10Bit (0-1023) audio band values
77// modified only by AudioRead()
78int left[7];
79int right[7];
80
81// noise stuff
82uint16_t speed = 10;
83uint16_t scale = 50;
84uint16_t scale2 = 30;
85const uint8_t kMatrixWidth = 16;
86const uint8_t kMatrixHeight = 16;
87#define MAX_DIMENSION \
88 ((kMatrixWidth > kMatrixHeight) ? kMatrixWidth : kMatrixHeight)
91uint16_t x;
92uint16_t y;
93uint16_t z;
94uint16_t x2;
95uint16_t y2;
96uint16_t z2;
97// palette stuff
98CRGBPalette16 currentPalette;
99TBlendType currentBlending;
100extern CRGBPalette16 myRedWhiteBluePalette;
102
103void ShowFrame();
104int XY(int x, int y);
105void Line(int x0, int y0, int x1, int y1, byte color);
106void Pixel(int x, int y, byte color);
107void ClearAll();
108void MoveOscillators();
109void ReadAudio();
110void DimAll(byte value);
111void Caleidoscope1();
112void Caleidoscope2();
113void Caleidoscope3();
114void Caleidoscope4();
115void Caleidoscope5();
116void Caleidoscope6();
117void SpiralStream(int x, int y, int r, byte dim);
118void HorizontalStream(byte scale);
119void VerticalStream(byte scale);
120void VerticalMove();
121void Copy(byte x0, byte y0, byte x1, byte y1, byte x2, byte y2);
122void RotateTriangle();
123void MirrorTriangle();
124void RainbowTriangle();
125
126void SlowMandala();
127void Dots1();
128void Dots2();
129void SlowMandala2();
130void SlowMandala3();
131void Mandala8();
132void MSGEQtest();
133void MSGEQtest2();
134void MSGEQtest3();
135void MSGEQtest4();
136void AudioSpiral();
137void MSGEQtest5();
138void MSGEQtest6();
139void MSGEQtest7();
140void MSGEQtest8();
141void MSGEQtest9();
142void CopyTest();
143void CopyTest2();
144void Scale(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
145void Audio1();
146void Audio2();
147void Audio3();
148void Audio4();
149void CaleidoTest1();
150void CaleidoTest2();
151void Audio5();
152void Audio6();
153void RenderCustomMatrix();
154void fillnoise8();
155void fillnoise82();
156void NoiseExample1();
157void FillNoise(uint16_t x, uint16_t y, uint16_t z, uint16_t scale);
158void NoiseExample2();
159void NoiseExample3();
160void SpeedTest();
161void NoiseExample4();
162void ReadAudio2();
163void NoiseExample5();
164void NoiseExample6();
167void NoiseExample8();
168void InitMSGEQ7();
169void NoiseExample7();
172
173/*
174-------------------------------------------------------------------
175 Basic Helper functions:
176
177 XY translate 2 dimensional coordinates into an index
178 Line draw a line
179 Pixel draw a pixel
180 ClearAll empty the screenbuffer
181 MoveOscillators increment osci[] and calculate p[]=sin8(osci)
182 InitMSGEQ7 activate the MSGEQ7
183 ReadAudio get data from MSGEQ7 into left[7] and right[7]
184
185 -------------------------------------------------------------------
186 */
187
188// translates from x, y into an index into the LED array and
189// finds the right index for a S shaped matrix
190int XY(int x, int y) {
191 if (y > HEIGHT) {
192 y = HEIGHT;
193 }
194 if (y < 0) {
195 y = 0;
196 }
197 if (x > WIDTH) {
198 x = WIDTH;
199 }
200 if (x < 0) {
201 x = 0;
202 }
203 // for a serpentine layout reverse every 2nd row:
204 if (x % 2 == 1) {
205 return (x * (WIDTH) + (HEIGHT - y - 1));
206 } else {
207 // use that line only, if you have all rows beginning at the same side
208 return (x * (WIDTH) + y);
209 }
210}
211
212// Bresenham line algorythm based on 2 coordinates
213void Line(int x0, int y0, int x1, int y1, byte color) {
214 int dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1;
215 int dy = -abs(y1 - y0), sy = y0 < y1 ? 1 : -1;
216 int err = dx + dy, e2;
217 for (;;) {
218 leds[XY(x0, y0)] = CHSV(color, 255, 255);
219 if (x0 == x1 && y0 == y1)
220 break;
221 e2 = 2 * err;
222 if (e2 > dy) {
223 err += dy;
224 x0 += sx;
225 }
226 if (e2 < dx) {
227 err += dx;
228 y0 += sy;
229 }
230 }
231}
232
233// write one pixel with HSV color to coordinates
234void Pixel(int x, int y, byte color) { leds[XY(x, y)] = CHSV(color, 255, 255); }
235
236// delete the screenbuffer
237void ClearAll() {
238 for (int i = 0; i < NUM_LEDS; i++) {
239 leds[i] = 0;
240 }
241}
242
243/*
244Oscillators and Emitters
245 */
246
247// set the speeds (and by that ratios) of the oscillators here
249 osci[0] = osci[0] + 5;
250 osci[1] = osci[1] + 2;
251 osci[2] = osci[2] + 3;
252 osci[3] = osci[3] + 4;
253 for (int i = 0; i < 4; i++) {
254 p[i] =
255 sin8(osci[i]) /
256 17; // why 17? to keep the result in the range of 0-15 (matrix size)
257 }
258}
259
260// wake up the MSGEQ7
262 pinMode(MSGEQ7_RESET_PIN, OUTPUT);
263 pinMode(MSGEQ7_STROBE_PIN, OUTPUT);
264 digitalWrite(MSGEQ7_RESET_PIN, LOW);
265 digitalWrite(MSGEQ7_STROBE_PIN, HIGH);
266}
267
268// get the data from the MSGEQ7
269// (still fucking slow...)
270void ReadAudio() {
271 digitalWrite(MSGEQ7_RESET_PIN, HIGH);
272 digitalWrite(MSGEQ7_RESET_PIN, LOW);
273 for (byte band = 0; band < 7; band++) {
274 digitalWrite(MSGEQ7_STROBE_PIN, LOW);
275 delayMicroseconds(30);
276 left[band] = analogRead(AUDIO_LEFT_PIN);
277 right[band] = analogRead(AUDIO_RIGHT_PIN);
278 digitalWrite(MSGEQ7_STROBE_PIN, HIGH);
279 }
280}
281
282/*
283-------------------------------------------------------------------
284 Functions for manipulating existing data within the screenbuffer:
285
286 DimAll scales the brightness of the screenbuffer down
287 Caleidoscope1 mirror one quarter to the other 3 (and overwrite them)
288 Caleidoscope2 rotate one quarter to the other 3 (and overwrite them)
289 Caleidoscope3 useless bullshit?!
290 Caleidoscope4 rotate and add the complete screenbuffer 3 times
291 Caleidoscope5 copy a triangle from the first quadrant to the other half
292 Caleidoscope6
293 SpiralStream stream = give it a nice fading tail
294 HorizontalStream
295 VerticalStream
296 VerticalMove move = just move it as it is one line down
297 Copy copy a rectangle
298 RotateTriangle copy + rotate a triangle (in 8*8)
299 MirrorTriangle copy + mirror a triangle (in 8*8)
300 RainbowTriangle static draw for debugging
301
302 -------------------------------------------------------------------
303 */
304
305// scale the brightness of the screenbuffer down
306void DimAll(byte value) {
307 for (int i = 0; i < NUM_LEDS; i++) {
308 leds[i].nscale8(value);
309 }
310}
311
312/*
313Caleidoscope1 mirrors from source to A, B and C
314
315 y
316
317 | |
318 | B | C
319 |_______________
320 | |
321 |source | A
322 |_______________ x
323
324 */
326 for (int x = 0; x < WIDTH / 2; x++) {
327 for (int y = 0; y < HEIGHT / 2; y++) {
328 leds[XY(WIDTH - 1 - x, y)] = leds[XY(x, y)]; // copy to A
329 leds[XY(x, HEIGHT - 1 - y)] = leds[XY(x, y)]; // copy to B
330 leds[XY(WIDTH - 1 - x, HEIGHT - 1 - y)] =
331 leds[XY(x, y)]; // copy to C
332 }
333 }
334}
335
336/*
337Caleidoscope2 rotates from source to A, B and C
338
339 y
340
341 | |
342 | C | B
343 |_______________
344 | |
345 |source | A
346 |_______________ x
347
348 */
350 for (int x = 0; x < WIDTH / 2; x++) {
351 for (int y = 0; y < HEIGHT / 2; y++) {
352 leds[XY(WIDTH - 1 - x, y)] = leds[XY(y, x)]; // rotate to A
353 leds[XY(WIDTH - 1 - x, HEIGHT - 1 - y)] =
354 leds[XY(x, y)]; // rotate to B
355 leds[XY(x, HEIGHT - 1 - y)] = leds[XY(y, x)]; // rotate to C
356 }
357 }
358}
359
360// adds the color of one quarter to the other 3
362 for (int x = 0; x < WIDTH / 2; x++) {
363 for (int y = 0; y < HEIGHT / 2; y++) {
364 leds[XY(WIDTH - 1 - x, y)] += leds[XY(y, x)]; // rotate to A
365 leds[XY(WIDTH - 1 - x, HEIGHT - 1 - y)] +=
366 leds[XY(x, y)]; // rotate to B
367 leds[XY(x, HEIGHT - 1 - y)] += leds[XY(y, x)]; // rotate to C
368 }
369 }
370}
371
372// add the complete screenbuffer 3 times while rotating
374 for (int x = 0; x < WIDTH; x++) {
375 for (int y = 0; y < HEIGHT; y++) {
376 leds[XY(WIDTH - 1 - x, y)] += leds[XY(y, x)]; // rotate to A
377 leds[XY(WIDTH - 1 - x, HEIGHT - 1 - y)] +=
378 leds[XY(x, y)]; // rotate to B
379 leds[XY(x, HEIGHT - 1 - y)] += leds[XY(y, x)]; // rotate to C
380 }
381 }
382}
383
384// rotate, duplicate and copy over a triangle from first sector into the other
385// half (crappy code)
387 for (int x = 1; x < 8; x++) {
388 leds[XY(7 - x, 7)] += leds[XY(x, 0)];
389 } // a
390 for (int x = 2; x < 8; x++) {
391 leds[XY(7 - x, 6)] += leds[XY(x, 1)];
392 } // b
393 for (int x = 3; x < 8; x++) {
394 leds[XY(7 - x, 5)] += leds[XY(x, 2)];
395 } // c
396 for (int x = 4; x < 8; x++) {
397 leds[XY(7 - x, 4)] += leds[XY(x, 3)];
398 } // d
399 for (int x = 5; x < 8; x++) {
400 leds[XY(7 - x, 3)] += leds[XY(x, 4)];
401 } // e
402 for (int x = 6; x < 8; x++) {
403 leds[XY(7 - x, 2)] += leds[XY(x, 5)];
404 } // f
405 for (int x = 7; x < 8; x++) {
406 leds[XY(7 - x, 1)] += leds[XY(x, 6)];
407 } // g
408}
409
411 for (int x = 1; x < 8; x++) {
412 leds[XY(7 - x, 7)] = leds[XY(x, 0)];
413 } // a
414 for (int x = 2; x < 8; x++) {
415 leds[XY(7 - x, 6)] = leds[XY(x, 1)];
416 } // b
417 for (int x = 3; x < 8; x++) {
418 leds[XY(7 - x, 5)] = leds[XY(x, 2)];
419 } // c
420 for (int x = 4; x < 8; x++) {
421 leds[XY(7 - x, 4)] = leds[XY(x, 3)];
422 } // d
423 for (int x = 5; x < 8; x++) {
424 leds[XY(7 - x, 3)] = leds[XY(x, 4)];
425 } // e
426 for (int x = 6; x < 8; x++) {
427 leds[XY(7 - x, 2)] = leds[XY(x, 5)];
428 } // f
429 for (int x = 7; x < 8; x++) {
430 leds[XY(7 - x, 1)] = leds[XY(x, 6)];
431 } // g
432}
433
434// create a square twister
435// x and y for center, r for radius
436void SpiralStream(int x, int y, int r, byte dim) {
437 for (int d = r; d >= 0; d--) { // from the outside to the inside
438 for (int i = x - d; i <= x + d; i++) {
439 leds[XY(i, y - d)] +=
440 leds[XY(i + 1, y - d)]; // lowest row to the right
441 leds[XY(i, y - d)].nscale8(dim);
442 }
443 for (int i = y - d; i <= y + d; i++) {
444 leds[XY(x + d, i)] += leds[XY(x + d, i + 1)]; // right colum up
445 leds[XY(x + d, i)].nscale8(dim);
446 }
447 for (int i = x + d; i >= x - d; i--) {
448 leds[XY(i, y + d)] +=
449 leds[XY(i - 1, y + d)]; // upper row to the left
450 leds[XY(i, y + d)].nscale8(dim);
451 }
452 for (int i = y + d; i >= y - d; i--) {
453 leds[XY(x - d, i)] += leds[XY(x - d, i - 1)]; // left colum down
454 leds[XY(x - d, i)].nscale8(dim);
455 }
456 }
457}
458
459// give it a linear tail to the side
461 for (int x = 1; x < WIDTH; x++) {
462 for (int y = 0; y < HEIGHT; y++) {
463 leds[XY(x, y)] += leds[XY(x - 1, y)];
464 leds[XY(x, y)].nscale8(scale);
465 }
466 }
467 for (int y = 0; y < HEIGHT; y++)
468 leds[XY(0, y)].nscale8(scale);
469}
470
471// give it a linear tail downwards
473 for (int x = 0; x < WIDTH; x++) {
474 for (int y = 1; y < HEIGHT; y++) {
475 leds[XY(x, y)] += leds[XY(x, y - 1)];
476 leds[XY(x, y)].nscale8(scale);
477 }
478 }
479 for (int x = 0; x < WIDTH; x++)
480 leds[XY(x, 0)].nscale8(scale);
481}
482
483// just move everything one line down
485 for (int y = 15; y > 0; y--) {
486 for (int x = 0; x < 16; x++) {
487 leds[XY(x, y)] = leds[XY(x, y - 1)];
488 }
489 }
490}
491
492// copy the rectangle defined with 2 points x0, y0, x1, y1
493// to the rectangle beginning at x2, x3
494void Copy(byte x0, byte y0, byte x1, byte y1, byte x2, byte y2) {
495 for (int y = y0; y < y1 + 1; y++) {
496 for (int x = x0; x < x1 + 1; x++) {
497 leds[XY(x + x2 - x0, y + y2 - y0)] = leds[XY(x, y)];
498 }
499 }
500}
501
502// rotate + copy triangle (8*8)
504 for (int x = 1; x < 8; x++) {
505 for (int y = 0; y < x; y++) {
506 leds[XY(x, 7 - y)] = leds[XY(7 - x, y)];
507 }
508 }
509}
510
511// mirror + copy triangle (8*8)
513 for (int x = 1; x < 8; x++) {
514 for (int y = 0; y < x; y++) {
515 leds[XY(7 - y, x)] = leds[XY(7 - x, y)];
516 }
517 }
518}
519
520// draw static rainbow triangle pattern (8x8)
521// (just for debugging)
523 for (int i = 0; i < 8; i++) {
524 for (int j = 0; j <= i; j++) {
525 Pixel(7 - i, j, i * j * 4);
526 }
527 }
528}
529
530/*
531-------------------------------------------------------------------
532 Examples how to combine functions in order to create an effect
533
534 ...or: how to visualize some of the following data
535 osci[0] ... osci[3] (0-255) triangle
536 p[0] ... p[3] (0-15) sinus
537 left[0] ... left[6] (0-1023) values of 63Hz, 160Hz, ...
538 right[0] ... right[6] (0-1023)
539
540 effects based only on oscillators (triangle/sine waves)
541
542 AutoRun shows everything that follows
543 SlowMandala red slow
544 Dots1 2 arround one
545 Dots2 stacking sines
546 SlowMandala2 just nice and soft
547 SlowMandala3 just nice and soft
548 Mandala8 copy one triangle all over
549
550 effects based on audio data (could be also linked to oscillators)
551
552 MSGEQtest colorfull 2 chanel 7 band analyzer
553 MSGEQtest2 2 frequencies linked to dot emitters in a spiral mandala
554 MSGEQtest3 analyzer 2 bars
555 MSGEQtest4 analyzer x 4 (as showed on youtube)
556 AudioSpiral basedrum/snare linked to red/green emitters
557 MSGEQtest5 one channel 7 band spectrum analyzer (spiral fadeout)
558 MSGEQtest6 classic analyzer, slow falldown
559 MSGEQtest7 spectrum mandala, color linked to low frequencies
560 MSGEQtest8 spectrum mandala, color linked to osci
561 MSGEQtest9 falling spectogram
562 CopyTest
563 Audio1
564 Audio2
565 Audio3
566 Audio4
567 CaleidoTest1
568 Caleidotest2
569 Audio5
570 Audio6
571 -------------------------------------------------------------------
572 */
573
574// all examples together
575void AutoRun() {
576 /*
577 // all oscillator based:
578 for(int i = 0; i < 300; i++) {Dots1();}
579 for(int i = 0; i < 300; i++) {Dots2();}
580 SlowMandala();
581 SlowMandala2();
582 SlowMandala3();
583 for(int i = 0; i < 300; i++) {Mandala8();}
584
585 // all MSGEQ7 based:
586 for(int i = 0; i < 500; i++) {MSGEQtest();}
587 for(int i = 0; i < 500; i++) {MSGEQtest2();}
588 for(int i = 0; i < 500; i++) {MSGEQtest3();}
589 for(int i = 0; i < 500; i++) {MSGEQtest4();}
590 for(int i = 0; i < 500; i++) {AudioSpiral();}
591 for(int i = 0; i < 500; i++) {MSGEQtest5();}
592 for(int i = 0; i < 500; i++) {MSGEQtest6();}
593 for(int i = 0; i < 500; i++) {MSGEQtest7();}
594 for(int i = 0; i < 500; i++) {MSGEQtest8();}
595 for(int i = 0; i < 500; i++) {MSGEQtest9();}
596 for(int i = 0; i < 500; i++) {CopyTest();}
597 for(int i = 0; i < 500; i++) {Audio1();}
598 for(int i = 0; i < 500; i++) {Audio2();}
599 for(int i = 0; i < 500; i++) {Audio3();}
600 for(int i = 0; i < 500; i++) {Audio4();}
601 for(int i = 0; i < 500; i++) {CaleidoTest1();}
602 for(int i = 0; i < 500; i++) {CaleidoTest2();}
603 for(int i = 0; i < 500; i++) {Audio5();}
604 for(int i = 0; i < 500; i++) {Audio6();}
605
606 for(int i = 0; i < 500; i++) {
607 NoiseExample1();
608 }
609 for(int i = 0; i < 500; i++) {
610 NoiseExample2();
611 }
612 for(int i = 0; i < 500; i++) {
613 NoiseExample3();
614 }
615 //SpeedTest();
616 for(int i = 0; i < 500; i++) {
617 NoiseExample4();
618 }
619 //for(int i = 0; i < 500; i++) {NoiseExample5();}
620 */
621 // NoiseExample6();
622 FASTLED_ASSERT(false, "breakpoint");
624}
625
626// red, 4 spirals, one dot emitter
627// demonstrates SpiralStream and Caleidoscope
628// (psychedelic)
630 for (int i = 0; i < 16; i++) {
631 for (int j = 0; j < 16; j++) {
632 Pixel(i, j, 1);
633 SpiralStream(4, 4, 4, 127);
635 ShowFrame();
637 }
638 }
639}
640
641// 2 oscillators flying arround one ;)
642void Dots1() {
644 // 2 lissajous dots red
645 leds[XY(p[0], p[1])] = CHSV(1, 255, 255);
646 leds[XY(p[2], p[3])] = CHSV(1, 255, 150);
647 // average of the coordinates in yellow
648 Pixel((p[2] + p[0]) / 2, (p[1] + p[3]) / 2, 50);
649 ShowFrame();
651 HorizontalStream(125);
652}
653
654// x and y based on 3 sine waves
655void Dots2() {
657 Pixel((p[2] + p[0] + p[1]) / 3, (p[1] + p[3] + p[2]) / 3, osci[3]);
658 ShowFrame();
659 // FastLED.delay(20);
660 HorizontalStream(125);
661}
662
663// beautifull but periodic
665 for (int i = 1; i < 8; i++) {
666 for (int j = 0; j < 16; j++) {
668 Pixel(j, i, (osci[0] + osci[1]) / 2);
669 SpiralStream(4, 4, 4, 127);
671 ShowFrame();
672 // FastLED.delay(20);
673 }
674 }
675}
676
677// same with a different timing
679 for (int i = 0; i < 16; i++) {
680 for (int j = 0; j < 16; j++) {
682 Pixel(j, j, (osci[0] + osci[1]) / 2);
683 SpiralStream(4, 4, 4, 127);
685 ShowFrame();
686 // FastLED.delay(20);
687 }
688 }
689}
690
691// 2 lissajou dots *2 *4
692void Mandala8() {
694 Pixel(p[0] / 2, p[1] / 2, osci[2]);
695 Pixel(p[2] / 2, p[3] / 2, osci[3]);
698 HorizontalStream(110);
699 ShowFrame();
700}
701
702// colorfull 2 chanel 7 band analyzer
703void MSGEQtest() {
704 ReadAudio();
705 for (int i = 0; i < 7; i++) {
706 Pixel(i, 16 - left[i] / 64, left[i] / 4);
707 }
708 for (int i = 0; i < 7; i++) {
709 Pixel(8 + i, 16 - right[i] / 64, right[i] / 4);
710 }
711 ShowFrame();
712 VerticalStream(120);
713}
714
715// 2 frequencies linked to dot emitters in a spiral mandala
717 ReadAudio();
718 if (left[0] > 500) {
719 Pixel(0, 0, 1);
720 Pixel(1, 1, 1);
721 }
722 if (left[2] > 200) {
723 Pixel(2, 2, 100);
724 }
725 if (left[6] > 200) {
726 Pixel(5, 0, 200);
727 }
728 SpiralStream(4, 4, 4, 127);
730 ShowFrame();
731}
732
733// analyzer 2 bars
735 ReadAudio();
736 for (int i = 0; i < 8; i++) {
737 Pixel(i, 16 - left[0] / 64, 1);
738 }
739 for (int i = 8; i < 16; i++) {
740 Pixel(i, 16 - left[4] / 64, 100);
741 }
742 ShowFrame();
743 VerticalStream(120);
744}
745
746// analyzer x 4 (as showed on youtube)
748 ReadAudio();
749 for (int i = 0; i < 7; i++) {
750 Pixel(7 - i, 8 - right[i] / 128, i * 10);
751 }
753 ShowFrame();
754 DimAll(240);
755}
756
757// basedrum/snare linked to red/green emitters
760 SpiralStream(7, 7, 7, 130);
761 SpiralStream(4, 4, 4, 122);
762 SpiralStream(11, 11, 3, 122);
763 ReadAudio();
764 if (left[1] > 500) {
765 leds[2, 1] = CHSV(1, 255, 255);
766 }
767 if (left[4] > 500) {
768 leds[XY(random(15), random(15))] = CHSV(100, 255, 255);
769 }
770 ShowFrame();
771 DimAll(250);
772}
773
774// one channel 7 band spectrum analyzer (spiral fadeout)
776 ReadAudio();
777 for (int i = 0; i < 7; i++) {
778 Line(2 * i, 16 - left[i] / 64, 2 * i, 15, i * 10);
779 Line(1 + 2 * i, 16 - left[i] / 64, 1 + 2 * i, 15, i * 10);
780 }
781 ShowFrame();
782 SpiralStream(7, 7, 7, 120);
783}
784
785// classic analyzer, slow falldown
787 ReadAudio();
788 for (int i = 0; i < 7; i++) {
789 Line(2 * i, 16 - left[i] / 64, 2 * i, 15, i * 10);
790 Line(1 + 2 * i, 16 - left[i] / 64, 1 + 2 * i, 15, i * 10);
791 }
792 ShowFrame();
793 VerticalStream(170);
794}
795
796// geile Scheiße
797// spectrum mandala, color linked to 160Hz band
800 ReadAudio();
801 for (int i = 0; i < 7; i++) {
802 Pixel(7 - i, 8 - right[i] / 128, i * 10 + right[1] / 8);
803 }
806 ShowFrame();
807 DimAll(240);
808}
809
810// spectrum mandala, color linked to osci
813 ReadAudio();
814 for (int i = 0; i < 7; i++) {
815 Pixel(7 - i, 8 - right[i] / 128, i * 10 + osci[1]);
816 }
819 ShowFrame();
820 DimAll(240);
821}
822
823// falling spectogram
825 ReadAudio();
826 for (int i = 0; i < 7; i++) {
827 leds[XY(i * 2, 0)] = CHSV(
828 i * 27, 255, right[i] / 3); // brightness should be divided by 4
829 leds[XY(1 + i * 2, 0)] = CHSV(i * 27, 255, left[i] / 3);
830 }
831 leds[XY(14, 0)] = 0;
832 leds[XY(15, 0)] = 0;
833 ShowFrame();
834 VerticalMove();
835}
836
837// 9 analyzers
838void CopyTest() {
839 ReadAudio();
840 for (int i = 0; i < 5; i++) {
841 Line(i, 4 - left[i] / 256, i, 4, i * 10);
842 }
843 Copy(0, 0, 4, 4, 5, 0);
844 Copy(0, 0, 4, 4, 10, 0);
845 Copy(0, 0, 14, 4, 0, 5);
846 Copy(0, 0, 14, 4, 0, 10);
847 ShowFrame();
848 DimAll(200);
849}
850
851// test scale
852// NOT WORKING as intended YET!
853void CopyTest2() {
854 ReadAudio();
855 for (int i = 0; i < 5; i++) {
856 Line(i * 2, 4 - left[i] / 128, i * 2, 4, i * 10);
857 }
858 Scale(0, 0, 4, 4, 7, 7, 15, 15);
859 ShowFrame();
860 DimAll(200);
861}
862
863// rechtangle 0-1 -> 2-3
864// NOT WORKING as intended YET!
865void Scale(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
866 for (int y = y2; y < y3 + 1; y++) {
867 for (int x = x2; x < x3 + 1; x++) {
868 leds[XY(x, y)] = leds[XY(x0 + ((x * (x1 - x0)) / (x3 - x1)),
869 y0 + ((y * (y1 - y0)) / (y3 - y1)))];
870 }
871 }
872}
873
874// line spectogram mandala
875void Audio1() {
876 ReadAudio();
877 for (int i = 0; i < 5; i++) {
878 Line(3 * i, 16 - left[i] / 64, 3 * (i + 1), 16 - left[i + 1] / 64,
879 255 - i * 15);
880 }
882 ShowFrame();
883 DimAll(10);
884}
885
886// line analyzer with stream
887void Audio2() {
888 ReadAudio();
889 for (int i = 0; i < 5; i++) {
890 Line(3 * i, 16 - left[i] / 64, 3 * (i + 1), 16 - left[i + 1] / 64,
891 255 - i * 15);
892 }
893 ShowFrame();
894 HorizontalStream(120);
895}
896
897void Audio3() {
898 ReadAudio();
899 for (int i = 0; i < 7; i++) {
900 leds[XY(6 - i, right[i] / 128)] = CHSV(i * 27, 255, right[i]);
901 } // brightness should be divided by 4
904 ShowFrame();
905 DimAll(255);
906}
907
908void Audio4() {
909 ReadAudio();
910 for (int i = 0; i < 5; i++) {
911 Line(3 * i, 8 - left[i] / 128, 3 * (i + 1), 8 - left[i + 1] / 128,
912 i * left[i] / 32);
913 }
915 ShowFrame();
916 DimAll(12);
917}
918
920 ReadAudio();
921 for (int i = 0; i < 7; i++) {
922 Line(i, left[i] / 256, i, 0, left[i] / 32);
923 }
925 Caleidoscope2(); // copy + rotate
926 ShowFrame();
927 DimAll(240);
928}
929
932 ReadAudio();
933 for (int i = 0; i < 7; i++) {
934 Line(i, left[i] / 200, i, 0, (left[i] / 16) + 150);
935 }
937 Caleidoscope1(); // mirror + rotate
938 ShowFrame();
939 DimAll(240);
940}
941
942void Audio5() {
943 ReadAudio();
944 for (int i = 0; i < 5; i++) {
945 Line(3 * i, 8 - left[i] / 128, // from
946 3 * (i + 1), 8 - left[i + 1] / 128, // to
947 i * 30);
948 } // color
950 ShowFrame();
951 DimAll(9);
952}
953
954void Audio6() {
955 ReadAudio();
956 for (int i = 0; i < 5; i++) {
957 Line(3 * i, 8 - left[i] / 128, // from
958 3 * (i + 1), 8 - left[i + 1] / 128, // to
959 i * 10); // lolor
960 Line(15 - (3 * i), 7 + left[i] / 128, // from
961 15 - (3 * (i + 1)), 7 + left[i + 1] / 128, // to
962 i * 10); // color
963 }
964 ShowFrame();
965 DimAll(200);
966 // ClearAll();
967}
968
969/*
970-------------------------------------------------------------------
971 Testcode for mapping the 16*16 calculation buffer to your
972 custom matrix size
973 -------------------------------------------------------------------
974
975 */
976// describe your matrix layout here:
977// P.S. If you use a 8*8 just remove the */ and /*
979 for (int x = 0; x < CUSTOM_WIDTH; x++) {
980 for (int y = 0; y < CUSTOM_HEIGHT; y++) {
981 // position in the custom array
982 leds2[x + x * y] =
983 // positions(s) in the source 16*16
984 // in this example it interpolates between just 2 diagonal
985 // touching pixels
986 (leds[XY(x * 2, y * 2)] + // first point added to
987 leds[XY(1 + (x * 2), 1 + (y * 2))]) // second point
988 ; // divided by 2 to get the average color
989 }
990 }
991}
992
993void ShowFrame() {
994 // when using a matrix different than 16*16 use
995 // RenderCustomMatrix();
996 GraphicsShow();
997 LEDS.countFPS();
998}
999
1001 for (int i = 0; i < MAX_DIMENSION; i++) {
1002 int ioffset = scale * i;
1003 for (int j = 0; j < MAX_DIMENSION; j++) {
1004 int joffset = scale * j;
1005 noise[i][j] = inoise8(x + ioffset, y + joffset, z);
1006 }
1007 }
1008 y += speed;
1009 // z += 2;
1010}
1011
1013 for (int i = 0; i < MAX_DIMENSION; i++) {
1014 int ioffset = scale2 * i;
1015 for (int j = 0; j < MAX_DIMENSION; j++) {
1016 int joffset = scale2 * j;
1017 noise2[i][j] = inoise8(x2 + ioffset, y2 + joffset, z2);
1018 }
1019 }
1020 y2 += speed * 3;
1021 // z += 2;
1022}
1023
1026 scale2 = 30 + p[1] * 3;
1027 x = p[0] * 16;
1028 fillnoise8();
1029 fillnoise82();
1030 for (int i = 0; i < kMatrixWidth; i++) {
1031 for (int j = 0; j < kMatrixHeight; j++) {
1032 leds[XY(i, j)] =
1033 CHSV(noise[i][j] << 1, 255, (noise2[i][j] + noise[i][j]) / 2);
1034 }
1035 }
1036
1037 ShowFrame();
1038}
1039
1040void FillNoise(uint16_t x, uint16_t y, uint16_t z, uint16_t scale) {
1041 for (int i = 0; i < MAX_DIMENSION; i++) {
1042 int ioffset = scale * i;
1043 for (int j = 0; j < MAX_DIMENSION; j++) {
1044 int joffset = scale * j;
1045 noise[i][j] = inoise8(x + ioffset, y + joffset, z);
1046 }
1047 }
1048}
1049
1052 FillNoise(2000 - p[2] * 100, 100, 100, 100);
1053 for (int i = 0; i < p[2]; i++) {
1054 for (int j = 0; j < kMatrixHeight; j++) {
1055 leds[XY(i, j)] = CRGB(noise[i][j], 0, 0);
1056 }
1057 }
1058 for (int i = 0; i < p[1]; i++) {
1059 for (int j = 0; j < kMatrixHeight; j++) {
1060 leds[XY(j, i)] += CRGB(0, 0, noise[i][j]);
1061 }
1062 }
1063 ShowFrame();
1064 ClearAll();
1065}
1066
1069 FillNoise(p[1] * 100, p[2] * 100, 100, 100);
1070 for (int i = 0; i < p[1]; i++) {
1071 for (int j = 0; j < kMatrixHeight; j++) {
1072 leds[XY(i, j)] = CHSV(noise[i][j], 255, 200);
1073 }
1074 }
1075
1076 for (int i = 0; i < p[3]; i++) {
1077 for (int j = 0; j < kMatrixHeight; j++) {
1078 leds[XY(j, i)] += CHSV(128 + noise[i][j], 255, 200);
1079 }
1080 }
1081
1082 ShowFrame();
1083 ClearAll();
1084}
1085
1087 ReadAudio();
1088 ShowFrame();
1089}
1090
1093 FillNoise(100, 100, 100, 100);
1094 for (int i = 0; i < p[0] + 1; i++) {
1095 for (int j = 0; j < kMatrixHeight; j++) {
1096 leds[XY(i, j)] += CHSV(noise[i][j + p[2]], 255, 255);
1097 }
1098 }
1099 ShowFrame();
1100 ClearAll();
1101}
1102
1104 digitalWrite(MSGEQ7_RESET_PIN, HIGH);
1105 digitalWrite(MSGEQ7_RESET_PIN, LOW);
1106 for (byte band = 0; band < 7; band++) {
1107 digitalWrite(MSGEQ7_STROBE_PIN, LOW);
1108 delayMicroseconds(30);
1109 left[band] = analogRead(AUDIO_LEFT_PIN) / 4;
1110 right[band] = analogRead(AUDIO_RIGHT_PIN) / 4;
1111 digitalWrite(MSGEQ7_STROBE_PIN, HIGH);
1112 }
1113}
1114
1117 ReadAudio();
1118 FillNoise(100, 100, 100, 300);
1119
1120 for (int i = 0; i < kMatrixWidth; i++) {
1121 for (int j = 0; j < left[1] / 64; j++) {
1122 leds[XY(i, 15 - j)] = CRGB(0, noise[i][left[1] / 64 - j], 0);
1123 }
1124 }
1125
1126 for (int i = 0; i < kMatrixWidth; i++) {
1127 for (int j = 0; j < left[5] / 64; j++) {
1128 leds[XY(j, i)] += CRGB(noise[i][left[5] / 64 - j], 0, 0);
1129 }
1130 }
1131 ShowFrame();
1132 ClearAll();
1133}
1134
1136 // MoveOscillators();
1137 for (int size = 1; size < 200; size++) {
1138 z++;
1139 FillNoise(size, size, z, size);
1140 for (int i = 0; i < kMatrixWidth; i++) {
1141 for (int j = 0; j < kMatrixHeight; j++) {
1142 leds[XY(i, j)] = CHSV(50 + noise[i][j], 255, 255);
1143 }
1144 }
1145 ShowFrame();
1146 // ClearAll();
1147 }
1148 for (int size = 200; size > 1; size--) {
1149 z++;
1150 FillNoise(size, size, z, size);
1151 for (int i = 0; i < kMatrixWidth; i++) {
1152 for (int j = 0; j < kMatrixHeight; j++) {
1153 leds[XY(i, j)] = CHSV(50 + noise[i][j], 255, 255);
1154 }
1155 }
1156 ShowFrame();
1157 // ClearAll();
1158 }
1159}
1160
1162 uint8_t secondHand = (millis() / 1000) % 60;
1163 static uint8_t lastSecond = 99;
1164
1165 if (lastSecond != secondHand) {
1166 lastSecond = secondHand;
1167 if (secondHand == 0) {
1169 currentBlending = LINEARBLEND;
1170 }
1171 if (secondHand == 10) {
1173 currentBlending = NOBLEND;
1174 }
1175 if (secondHand == 15) {
1177 currentBlending = LINEARBLEND;
1178 }
1179 if (secondHand == 20) {
1181 currentBlending = LINEARBLEND;
1182 }
1183 if (secondHand == 25) {
1185 currentBlending = LINEARBLEND;
1186 }
1187 if (secondHand == 30) {
1189 currentBlending = NOBLEND;
1190 }
1191 if (secondHand == 35) {
1193 currentBlending = LINEARBLEND;
1194 }
1195 if (secondHand == 40) {
1197 currentBlending = LINEARBLEND;
1198 }
1199 if (secondHand == 45) {
1201 currentBlending = LINEARBLEND;
1202 }
1203 if (secondHand == 50) {
1205 currentBlending = NOBLEND;
1206 }
1207 if (secondHand == 55) {
1209 currentBlending = LINEARBLEND;
1210 }
1211 }
1212}
1213
1215 for (int i = 0; i < 16; i++) {
1216 currentPalette[i] = CHSV(random8(), 255, random8());
1217 }
1218}
1219
1220// This function sets up a palette of black and white stripes,
1221// using code. Since the palette is effectively an array of
1222// sixteen CRGB colors, the various fill_* functions can be used
1223// to set them up.
1225 // 'black out' all 16 palette entries...
1227 // and set every fourth one to white.
1232}
1233
1234// This function sets up a palette of purple and green stripes.
1236 CRGB purple = CHSV(HUE_PURPLE, 255, 255);
1237 CRGB green = CHSV(HUE_GREEN, 255, 255);
1238 CRGB black = CRGB::Black;
1239
1241 CRGBPalette16(green, green, black, black, purple, purple, black, black,
1242 green, green, black, black, purple, purple, black, black);
1243}
1244
1245// This example shows how to set up a static color palette
1246// which is stored in PROGMEM (flash), which is almost always more
1247// plentiful than RAM. A static PROGMEM palette like this
1248// takes up 64 bytes of flash.
1260 for (int size = 1; size < 100; size++) {
1261 z++;
1262 FillNoise(size * 3, size * 3, z, size);
1263 for (int i = 0; i < kMatrixWidth; i++) {
1264 for (int j = 0; j < kMatrixHeight; j++) {
1266 255, currentBlending);
1267 }
1268 }
1269 ShowFrame();
1270 }
1271 for (int size = 100; size > 1; size--) {
1272 z++;
1273 FillNoise(size * 3, size * 3, z, size);
1274 for (int i = 0; i < kMatrixWidth; i++) {
1275 for (int j = 0; j < kMatrixHeight; j++) {
1277 255, currentBlending);
1278 }
1279 }
1280 ShowFrame();
1281 }
1282}
1283
1286 x++;
1287 z++;
1288 FillNoise(x * 3, x * 3, z, sin8(x) >> 1);
1289 for (int i = 0; i < kMatrixWidth; i++) {
1290 for (int j = 0; j < kMatrixHeight; j++) {
1291 leds[XY(i, j)] = ColorFromPalette(currentPalette, noise[i][j], 255,
1293 }
1294 }
1295 ShowFrame();
1296}
1297
1299 InitMSGEQ7();
1300
1301 x = random16();
1302 y = random16();
1303 z = random16();
1304
1305 x2 = random16();
1306 y2 = random16();
1307 z2 = random16();
1308 InitGraphics();
1309
1310}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
int y
Definition Audio.ino:72
#define WIDTH
Definition Audio.ino:33
int x
Definition Audio.ino:71
#define HEIGHT
Definition Audio.ino:32
UISlider speed("Speed", 1.0f, -20.0f, 20.0f, 0.01f)
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
CRGB leds2[lengths[RedStrip]]
TBlendType currentBlending
const TProgmemPalette16 myRedWhiteBluePalette_p
CRGBPalette16 currentPalette
CRGBPalette16 myRedWhiteBluePalette
central include file for FastLED, defines the CFastLED class/object
uint8_t noise[NUM_LAYERS][WIDTH][HEIGHT]
Definition Fire2023.ino:88
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:84
uint8_t noise2[NUM_LAYERS][WIDTH][HEIGHT]
Definition Fire2023.ino:89
#define CUSTOM_WIDTH
Definition defs.h:16
#define MSGEQ7_RESET_PIN
Definition defs.h:21
#define AUDIO_RIGHT_PIN
Definition defs.h:23
#define MSGEQ7_STROBE_PIN
Definition defs.h:20
#define AUDIO_LEFT_PIN
Definition defs.h:22
#define CUSTOM_HEIGHT
Definition defs.h:17
#define kMatrixHeight
#define kMatrixWidth
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
Definition fill.cpp:9
#define TProgmemPalette16
Alias for TProgmemRGBPalette16.
void SetupTotallyRandomPalette()
Definition funky.cpp:1214
void VerticalMove()
Definition funky.cpp:484
void CopyTest()
Definition funky.cpp:838
void AudioSpiral()
Definition funky.cpp:758
void ReadAudio2()
Definition funky.cpp:1103
void NoiseExample5()
Definition funky.cpp:1115
void CopyTest2()
Definition funky.cpp:853
int XY(int x, int y)
Definition funky.cpp:190
void Audio1()
Definition funky.cpp:875
void InitFunky()
Definition funky.cpp:1298
void Caleidoscope2()
Definition funky.cpp:349
void InitMSGEQ7()
Definition funky.cpp:261
void SpiralStream(int x, int y, int r, byte dim)
Definition funky.cpp:436
void Caleidoscope6()
Definition funky.cpp:410
uint16_t z2
Definition funky.cpp:96
void MSGEQtest6()
Definition funky.cpp:786
void SlowMandala2()
Definition funky.cpp:664
void Caleidoscope1()
Definition funky.cpp:325
void SlowMandala()
Definition funky.cpp:629
void MirrorTriangle()
Definition funky.cpp:512
void NoiseExample2()
Definition funky.cpp:1050
void Audio3()
Definition funky.cpp:897
void ChangePalettePeriodically()
Definition funky.cpp:1161
void NoiseExample6()
Definition funky.cpp:1135
void MSGEQtest()
Definition funky.cpp:703
void Dots2()
Definition funky.cpp:655
void NoiseExample3()
Definition funky.cpp:1067
void MSGEQtest8()
Definition funky.cpp:811
void RotateTriangle()
Definition funky.cpp:503
void MSGEQtest4()
Definition funky.cpp:747
void MSGEQtest7()
Definition funky.cpp:798
void NoiseExample4()
Definition funky.cpp:1091
int right[7]
Definition funky.cpp:79
void fillnoise8()
Definition funky.cpp:1000
void Audio5()
Definition funky.cpp:942
void Audio6()
Definition funky.cpp:954
void ReadAudio()
Definition funky.cpp:270
void RenderCustomMatrix()
Definition funky.cpp:978
void SlowMandala3()
Definition funky.cpp:678
#define MAX_DIMENSION
Definition funky.cpp:87
void CaleidoTest1()
Definition funky.cpp:919
void HorizontalStream(byte scale)
Definition funky.cpp:460
void CaleidoTest2()
Definition funky.cpp:930
void NoiseExample1()
Definition funky.cpp:1024
void Dots1()
Definition funky.cpp:642
void fillnoise82()
Definition funky.cpp:1012
void Pixel(int x, int y, byte color)
Definition funky.cpp:234
void Scale(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
Definition funky.cpp:865
void Audio4()
Definition funky.cpp:908
void MSGEQtest2()
Definition funky.cpp:716
void Mandala8()
Definition funky.cpp:692
void Caleidoscope4()
Definition funky.cpp:373
const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM
Definition funky.cpp:1249
void DimAll(byte value)
Definition funky.cpp:306
uint16_t y2
Definition funky.cpp:95
void ClearAll()
Definition funky.cpp:237
byte osci[4]
Definition funky.cpp:70
void Caleidoscope3()
Definition funky.cpp:361
void Audio2()
Definition funky.cpp:887
int left[7]
Definition funky.cpp:78
void Caleidoscope5()
Definition funky.cpp:386
uint16_t x2
Definition funky.cpp:94
void NoiseExample8()
Definition funky.cpp:1284
void ShowFrame()
Definition funky.cpp:993
void FillNoise(uint16_t x, uint16_t y, uint16_t z, uint16_t scale)
Definition funky.cpp:1040
void NoiseExample7()
Definition funky.cpp:1258
void Line(int x0, int y0, int x1, int y1, byte color)
Definition funky.cpp:213
void MSGEQtest9()
Definition funky.cpp:824
void Copy(byte x0, byte y0, byte x1, byte y1, byte x2, byte y2)
Definition funky.cpp:494
void SetupPurpleAndGreenPalette()
Definition funky.cpp:1235
void MSGEQtest3()
Definition funky.cpp:734
void VerticalStream(byte scale)
Definition funky.cpp:472
void SpeedTest()
Definition funky.cpp:1086
void MoveOscillators()
Definition funky.cpp:248
void RainbowTriangle()
Definition funky.cpp:522
void AutoRun()
Definition funky.cpp:575
void MSGEQtest5()
Definition funky.cpp:775
void SetupBlackAndWhiteStripedPalette()
Definition funky.cpp:1224
uint16_t scale2
Definition funky.cpp:84
void InitGraphics()
Definition gfx.cpp:10
void GraphicsShow()
Definition gfx.cpp:22
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
Definition noise.cpp:590
@ HUE_PURPLE
Purple (270°)
Definition chsv.h:104
@ HUE_GREEN
Green (135°)
Definition chsv.h:101
const TProgmemRGBPalette16 RainbowStripeColors_p
HSV Rainbow colors with alternatating stripes of black.
const TProgmemRGBPalette16 CloudColors_p
Cloudy color palette.
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.
LIB8STATIC uint16_t random16()
Generate a 16-bit random number.
Definition random8.h:56
LIB8STATIC uint8_t random8()
Generate an 8-bit random number.
Definition random8.h:46
#define sin8
Platform-independent alias of the fast sin implementation.
Definition trig8.h:221
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:30
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16
@ White
<div style='background:#FFFFFF;width:4em;height:4em;'></div>
Definition crgb.h:640
@ Gray
<div style='background:#808080;width:4em;height:4em;'></div>
Definition crgb.h:550
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Definition crgb.h:506
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:616
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:504
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55