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

◆ loop()

void loop ( )

Definition at line 157 of file FxSdCard.ino.

157 {
158 static bool s_first = true;
159 if (s_first) {
160 s_first = false;
161 Serial.println("First loop.");
162 }
163 if (gError) {
164 // If an error occurred, print a warning every second
165 EVERY_N_SECONDS(1) {
166 FL_WARN("No loop because an error occured.");
167 }
168 return;
169 }
170
171 // Select the video to play based on the UI input
172 fl::Video& vid = !bool(whichVideo.value()) ? video : video2;
174
175 // Get the current time and draw the video frame
176 uint32_t now = fl::millis();
177 vid.draw(now, leds);
178 FastLED.show();
179}
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::Video video(NUM_LEDS, 2.0f)
bool gError
Definition FxSdCard.ino:72
fl::UISlider videoSpeed("fl::Video Speed", 1.0f, -1, 2.0f, 0.01f)
UINumberField whichVideo("Which fl::Video", 0, 0, 1)
fl::Video video2
Definition FxSdCard.ino:66
void draw(DrawContext context) override
Definition video.cpp.hpp:71
void setTimeScale(float timeScale)
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Definition lib8tion.h:1010
#define FL_WARN(X)
Definition log.h:276
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
#define Serial
Definition serial.h:304

References fl::Video::draw(), EVERY_N_SECONDS, FastLED, FL_WARN, gError, leds, fl::millis(), Serial, fl::Video::setTimeScale(), video, video2, videoSpeed, and whichVideo().

+ Here is the call graph for this function: