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

Function loop

examples/wasm/wasm_impl.h:123–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void loop() {
124 uint32_t now = fl::millis();
125 FastLED.setBrightness(!isOff ? brightness.as<uint8_t>() : 0);
126 noisePalette.setSpeed(speed);
127 noisePalette.setScale(scale);
128 fxEngine.setSpeed(timeSpeed);
129
130 if (changeFx) {
131 fxEngine.nextFx();
132 }
133 // We use the dynamic version here which allows the change time to respond
134 // to changes from the UI element.
135 EVERY_N_MILLISECONDS_DYNAMIC(changePalletTime.as<int>() * 1000) {
136 if (changePallete) {
137 noisePalette.changeToRandomPalette();
138 }
139 }
140
141 if (changePalette) {
142 noisePalette.changeToRandomPalette();
143
144 }
145
146 // Do a change of palette if the button is pressed.
147 static int lastFxIndex = -1;
148 if (fxIndex.value() != lastFxIndex) {
149 lastFxIndex = fxIndex;
150 animartrix.fxSet(fxIndex);
151 }
152
153
154 fxEngine.draw(now, leds);
155 FastLED.show();
156}

Callers

nothing calls this directly

Calls 10

nextFxMethod · 0.80
changeToRandomPaletteMethod · 0.80
fxSetMethod · 0.80
millisFunction · 0.50
setBrightnessMethod · 0.45
setSpeedMethod · 0.45
setScaleMethod · 0.45
valueMethod · 0.45
drawMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected