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

Function wavefx_setup

examples/Fx/FxWave2d/wavefx.cpp:367–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367void wavefx_setup() {
368 // Create a screen map for visualization in the FastLED web compiler
369 auto screenmap = xyMap.toScreenMap();
370 screenmap.setDiameter(.2); // Set the size of the LEDs in the visualization
371
372 // Initialize the LED strip:
373 // - NEOPIXEL is the LED type
374 // - 2 is the data pin number (for real hardware)
375 // - setScreenMap connects our 2D coordinate system to the 1D LED fl::array
376 FastLED.addLeds<NEOPIXEL, 2>(leds, NUM_LEDS).setScreenMap(screenmap);
377
378 // Set up UI groupings
379 // Main Controls
380 title.setGroup("Main Controls");
381 description.setGroup("Main Controls");
382 button.setGroup("Main Controls");
383 buttonFancy.setGroup("Main Controls");
384 autoTrigger.setGroup("Main Controls");
385 triggerSpeed.setGroup("Main Controls");
386
387 // Global Settings
388 xCyclical.setGroup("Global Settings");
389 easeModeSqrt.setGroup("Global Settings");
390 useChangeGrid.setGroup("Global Settings");
391 blurAmount.setGroup("Global Settings");
392 blurPasses.setGroup("Global Settings");
393 superSample.setGroup("Global Settings");
394
395 // Upper Wave Layer
396 speedUpper.setGroup("Upper Wave Layer");
397 dampeningUpper.setGroup("Upper Wave Layer");
398 halfDuplexUpper.setGroup("Upper Wave Layer");
399 blurAmountUpper.setGroup("Upper Wave Layer");
400 blurPassesUpper.setGroup("Upper Wave Layer");
401 isotropicStencilUpper.setGroup("Upper Wave Layer");
402
403 // Lower Wave Layer
404 speedLower.setGroup("Lower Wave Layer");
405 dampeningLower.setGroup("Lower Wave Layer");
406 halfDuplexLower.setGroup("Lower Wave Layer");
407 blurAmountLower.setGroup("Lower Wave Layer");
408 blurPassesLower.setGroup("Lower Wave Layer");
409 isotropicStencilLower.setGroup("Lower Wave Layer");
410
411 // Fancy Effects
412 fancySpeed.setGroup("Fancy Effects");
413 fancyIntensity.setGroup("Fancy Effects");
414 fancyParticleSpan.setGroup("Fancy Effects");
415
416 // Add both wave layers to the blender
417 // The order matters - lower layer is added first (background)
418 fxBlend.add(waveFxLower);
419 fxBlend.add(waveFxUpper);
420}
421
422
423void wavefx_loop() {

Callers

nothing calls this directly

Calls 5

setDiameterMethod · 0.80
toScreenMapMethod · 0.45
setScreenMapMethod · 0.45
setGroupMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected