FastLED 3.9.15
Loading...
Searching...
No Matches

◆ SpiralStream()

void SpiralStream ( int x,
int y,
int r,
byte dim )

Definition at line 436 of file funky.cpp.

436 {
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}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71
int XY(int x, int y)
Definition funky.cpp:190

References leds, x, XY(), and y.

Referenced by AudioSpiral(), MSGEQtest2(), MSGEQtest5(), SlowMandala(), SlowMandala2(), and SlowMandala3().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: