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

◆ wavefx_loop()

void wavefx_loop ( )

Definition at line 369 of file wavefx.cpp.

369 {
370 // The main program loop that runs continuously
371
372 // Get the current time in milliseconds
373 uint32_t now = millis();
374
375 // set the x cyclical
376 waveFxLower.setXCylindrical(xCyclical.value()); // Set whether lower wave wraps around x-axis
377
378 // Apply all UI settings and get button states
379 ui_state state = ui();
380
381 // Check if the regular ripple button was pressed
382 if (state.button) {
383 triggerRipple(); // Create a single ripple
384 }
385
386 // Apply the fancy cross effect if its button is pressed
387 applyFancyEffect(now, state.bigButton);
388
389 // Handle automatic triggering of ripples
391
392 // Create a drawing context with the current time and LED array
393 Fx::DrawContext ctx(now, leds);
394
395 // Draw the blended result of both wave layers to the LED array
396 fxBlend.draw(ctx);
397
398 // Send the color data to the actual LEDs
399 FastLED.show();
400}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
CFastLED FastLED
Global LED strip management instance.
_DrawContext DrawContext
Definition fx.h:21
bool bigButton
Definition wavefx.cpp:252
bool button
Definition wavefx.cpp:251
Blend2d fxBlend(xyMap)
ui_state ui()
Definition wavefx.cpp:256
WaveFx waveFxLower(xyRect, CreateArgsLower())
void processAutoTrigger(uint32_t now)
Definition wavefx.cpp:307
UICheckbox xCyclical("X Is Cyclical", false)
void triggerRipple()
Definition wavefx.cpp:146
void applyFancyEffect(uint32_t now, bool button_active)
Definition wavefx.cpp:167

References applyFancyEffect(), ui_state::bigButton, ui_state::button, FastLED, fxBlend, leds, processAutoTrigger(), triggerRipple(), ui(), waveFxLower, and xCyclical.

Referenced by loop().

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