@@ -67,6 +67,7 @@ NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);
67
67
#define LED_TYPE WS2812B
68
68
#define COLOR_ORDER GRB
69
69
#define NUM_LEDS 256
70
+ #define NUM_LEDS_3 NUM_LEDS * 3
70
71
71
72
#define MILLI_AMPS 2000 // IMPORTANT: set the max milli-Amps of your power supply (4A = 4000mA)
72
73
#define FRAMES_PER_SECOND 120 // here you can control the speed. With the Access Point / Web Server the animations run a bit slower.
@@ -200,6 +201,7 @@ PatternAndNameList patterns = {
200
201
{ swirlFibonacci, " Swirl Fibonacci" },
201
202
{ fireFibonacci, " Fire Fibonacci" },
202
203
{ waterFibonacci, " Water Fibonacci" },
204
+ { emitterFibonacci, " Emitter Fibonacci" },
203
205
204
206
{ pacifica_loop, " Pacifica" },
205
207
{ pacifica_fibonacci_loop, " Pacifica Fibonacci" },
@@ -1457,6 +1459,45 @@ void waterFibonacci() {
1457
1459
}
1458
1460
}
1459
1461
1462
+ /* *
1463
+ * Emits arcs of color spreading out from the center to the edge of the disc.
1464
+ */
1465
+ void emitterFibonacci () {
1466
+ static CRGB ledBuffer[NUM_LEDS]; // buffer for better fade behavior
1467
+ const uint8_t dAngle = 32 ; // angular span of the traces
1468
+ const uint8_t dRadius = 12 ; // radial width of the traces
1469
+ const uint8_t vSpeed = 16 ; // max speed variation
1470
+
1471
+ static const uint8_t eCount = 7 ; // Number of simultanious traces
1472
+ static uint8_t angle[eCount]; // individual trace angles
1473
+ static uint16_t timeOffset[eCount]; // individual offsets from beat8() function
1474
+ static uint8_t speedOffset[eCount]; // individual speed offsets limited by vSpeed
1475
+ static uint8_t sparkIdx = 0 ; // randomizer cycles through traces to spark new ones
1476
+
1477
+ // spark new trace
1478
+ EVERY_N_MILLIS (20 ) {
1479
+ if (random8 (17 ) <= (speed >> 4 )) { // increase change rate for higher speeds
1480
+ angle[sparkIdx] = random8 ();
1481
+ speedOffset[sparkIdx] = random8 (vSpeed); // individual speed variation
1482
+ timeOffset[sparkIdx] = beat8 (qadd8 (speed,speedOffset[sparkIdx]));
1483
+ sparkIdx = addmod8 (sparkIdx, 1 , eCount); // continue randomizer at next spark
1484
+ }
1485
+ }
1486
+
1487
+ // fade traces
1488
+ fadeToBlackBy ( ledBuffer, NUM_LEDS, 6 + (speed >> 3 ));
1489
+
1490
+ // draw traces
1491
+ for (uint8_t e = 0 ; e < eCount; e++) {
1492
+ uint8_t startRadius = sub8 (beat8 (qadd8 (speed, speedOffset[e])), timeOffset[e]);
1493
+ uint8_t endRadius = add8 (startRadius, dRadius + (speed>>5 )); // increase radial width for higher speeds
1494
+ antialiasPixelAR (angle[e], dAngle, startRadius, endRadius, ColorFromPalette (gCurrentPalette , startRadius), ledBuffer);
1495
+ }
1496
+
1497
+ // copy buffer to actual strip
1498
+ memcpy (leds, ledBuffer, NUM_LEDS_3);
1499
+ }
1500
+
1460
1501
void wheel () {
1461
1502
for (uint16_t i = 0 ; i < NUM_LEDS; i++) {
1462
1503
uint8_t j = beat8 (speed);
0 commit comments