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

Function loop

examples/Wave2d/Wave2d.h:89–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void loop() {
90 // Your code here
91 waveSim.setXCylindrical(xCyclical.value());
92 waveSim.setSpeed(slider);
93 waveSim.setDampening(dampening);
94 waveSim.setHalfDuplex(halfDuplex);
95 waveSim.setSuperSample(getSuperSample());
96 // Apply after setSuperSample() so the user's choice survives the
97 // wrapper's multiplier-based auto-select for the stencil.
98 waveSim.setStencil(isotropicStencil
99 ? fl::LaplacianStencil::NinePointIsotropic
100 : fl::LaplacianStencil::FivePoint);
101 if (button) {
102 triggerRipple(waveSim);
103 }
104
105
106 EVERY_N_MILLISECONDS(400) {
107 if (autoTrigger) {
108 triggerRipple(waveSim);
109 }
110 }
111
112 waveSim.update();
113 for (int y = 0; y < HEIGHT; y++) {
114 for (int x = 0; x < WIDTH; x++) {
115 uint8_t value8 = waveSim.getu8(x, y);
116 uint32_t idx = xyMap.mapToIndex(x, y);
117 leds[idx] = fl::CRGB(value8, value8, value8);
118 }
119 }
120 FastLED.show();
121}

Callers

nothing calls this directly

Calls 14

getSuperSampleFunction · 0.70
triggerRippleFunction · 0.70
CRGBClass · 0.50
setXCylindricalMethod · 0.45
valueMethod · 0.45
setSpeedMethod · 0.45
setDampeningMethod · 0.45
setHalfDuplexMethod · 0.45
setSuperSampleMethod · 0.45
setStencilMethod · 0.45
updateMethod · 0.45
getu8Method · 0.45

Tested by

no test coverage detected