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

◆ wavefx_loop()

void wavefx_loop ( )

Definition at line 370 of file wavefx.cpp.

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

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: