MCPcopy Create free account
hub / github.com/FastLED/FastLED / wavefx_loop

Function wavefx_loop

examples/Fx/FxWave2d/wavefx.cpp:423–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421
422
423void wavefx_loop() {
424 // The main program loop that runs continuously
425
426 // Get the current time in milliseconds
427 uint32_t now = fl::millis();
428
429 // set the x cyclical
430 waveFxLower.setXCylindrical(xCyclical.value()); // Set whether lower wave wraps around x-axis
431
432 // Apply all UI settings and get button states
433 ui_state state = ui();
434
435 // Check if the regular ripple button was pressed
436 if (state.button) {
437 triggerRipple(); // Create a single ripple
438 }
439
440 // Apply the fancy cross effect if its button is pressed
441 applyFancyEffect(now, state.bigButton);
442
443 // Handle automatic triggering of ripples
444 processAutoTrigger(now);
445
446 // Create a drawing context with the current time and LED fl::array
447 fl::Fx::DrawContext ctx(now, leds);
448
449 // Draw the blended result of both wave layers to the LED fl::array
450 fxBlend.draw(ctx);
451
452 // Send the color data to the actual LEDs
453 FastLED.show();
454}
455
456
457#endif // SKETCH_HAS_LARGE_MEMORY

Callers

nothing calls this directly

Calls 9

uiFunction · 0.85
applyFancyEffectFunction · 0.85
processAutoTriggerFunction · 0.85
triggerRippleFunction · 0.70
millisFunction · 0.50
setXCylindricalMethod · 0.45
valueMethod · 0.45
drawMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected