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

◆ loop()

void loop ( )

Definition at line 124 of file wasm_impl.h.

124 {
125 uint32_t now = millis();
126 FastLED.setBrightness(!isOff ? brightness.as<uint8_t>() : 0);
127 noisePalette.setSpeed(speed);
128 noisePalette.setScale(scale);
129 fxEngine.setSpeed(timeSpeed);
130
131 if (changeFx) {
132 fxEngine.nextFx();
133 }
134 // We use the dynamic version here which allows the change time to respond
135 // to changes from the UI element.
137 if (changePallete) {
138 noisePalette.changeToRandomPalette();
139 }
140 }
141
142 if (changePalette) {
143 noisePalette.changeToRandomPalette();
144
145 }
146
147 // Do a change of palette if the button is pressed.
148 static int lastFxIndex = -1;
149 if (fxIndex.value() != lastFxIndex) {
150 lastFxIndex = fxIndex;
151 animartrix.fxSet(fxIndex);
152 }
153
154
155 fxEngine.draw(now, leds);
156 FastLED.show();
157}
CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
uint16_t speed
Definition Noise.ino:63
uint16_t scale
Definition Noise.ino:74
UISlider brightness("Brightness", 128, 0, 255, 1)
fl::unique_ptr< Animartrix > animartrix
Definition curr.h:298
fl::unique_ptr< FxEngine > fxEngine
Definition curr.h:299
CRGBPalette16 noisePalette
Definition curr.h:255
#define EVERY_N_MILLISECONDS_DYNAMIC(PERIOD_FUNC)
Checks whether to execute a block of code every N milliseconds, where N is determined dynamically.
Definition lib8tion.h:1226
UIButton changeFx("Switch between Noise & Animartrix")
UINumberField fxIndex("Animartrix - index", 0, 0, NUM_ANIMATIONS)
UISlider timeSpeed("Time Speed", 1, -10, 10,.1)
UICheckbox isOff("Off", false)
UISlider changePalletTime("Noise - Time until next random Palette", 5, 1, 100)
UICheckbox changePallete("Noise - Auto Palette", true)
UIButton changePalette("Noise - Next Palette")

References animartrix, brightness(), changeFx(), changePalette(), changePallete(), changePalletTime(), EVERY_N_MILLISECONDS_DYNAMIC, FastLED, fxEngine, fxIndex(), isOff(), leds, noisePalette, scale, speed, and timeSpeed().

+ Here is the call graph for this function: