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

◆ loop()

void loop ( )

Definition at line 120 of file wasm.ino.

120 {
121 uint32_t now = millis();
122 FastLED.setBrightness(!isOff ? brightness.as<uint8_t>() : 0);
123 noisePalette.setSpeed(speed);
124 noisePalette.setScale(scale);
125 fxEngine.setSpeed(timeSpeed);
126
127 if (changeFx) {
128 fxEngine.nextFx();
129 }
130 static int frame = 0;
131 // We use the dynamic version here which allows the change time to respond
132 // to changes from the UI element.
134 if (changePallete) {
135 noisePalette.changeToRandomPalette();
136 }
137 }
138
139 if (changePalette) {
140 noisePalette.changeToRandomPalette();
141
142 }
143
144 // Do a change of palette if the button is pressed.
145 static int lastFxIndex = -1;
146 if (fxIndex.value() != lastFxIndex) {
147 lastFxIndex = fxIndex;
148 animartrix.fxSet(fxIndex);
149 }
150
151
152 fxEngine.draw(now, leds);
153 FastLED.show();
154 frame++;
155}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:62
FxEngine fxEngine(NUM_LEDS)
UISlider brightness("Brightness", 1, 0, 1)
uint16_t speed
Definition funky.cpp:82
uint16_t scale
Definition funky.cpp:83
#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:1346
UISlider changePalletTime("Noise - Time until next random Palette", 5, 1, 100)
UIButton changePalette("Noise - Next Palette")
UISlider timeSpeed("Time Speed", 1, -10, 10,.1)
UICheckbox changePallete("Noise - Auto Palette", true)
UIButton changeFx("Switch between Noise & Animartrix")
UINumberField fxIndex("Animartrix - index", 0, 0, NUM_ANIMATIONS)
NoisePalette noisePalette
Definition wasm.ino:80
UICheckbox isOff("Off", false)
Animartrix animartrix(xyMap, POLAR_WAVES)

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