FastLED 3.10.8
Loading...
Searching...
No Matches

◆ draw()

void fl::DemoReel100::draw ( DrawContext context)
inlineoverridevirtual
Parameters
nowThe current time in milliseconds. Fx writers are encouraged to use this instead of millis() directly as this will more deterministic behavior.

Implements fl::Fx.

Definition at line 24 of file demoreel100.h.

24 {
25 fl::span<CRGB> leds = context.leds;
26 if (leds.empty() || mNumLeds == 0) {
27 return;
28 }
29 if (start_time == 0) {
31 }
32
33 // Call the current pattern function once, updating the 'leds' array
35
36 // do some periodic updates
38 hue++;
39 } // slowly cycle the "base color" through the rainbow
40 EVERY_N_SECONDS(10) { nextPattern(); } // change patterns periodically
41 }
CRGB leds[1]
void runPattern(fl::span< CRGB > leds) FL_NO_EXCEPT
Definition demoreel100.h:56
void nextPattern() FL_NO_EXCEPT
Definition demoreel100.h:50
unsigned long start_time
Definition demoreel100.h:48
u16 mNumLeds
Definition fx.h:53
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1045
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Definition lib8tion.h:1010
fl::u32 millis() FL_NO_EXCEPT
Universal millisecond timer - returns milliseconds since system startup.

References EVERY_N_MILLISECONDS, EVERY_N_SECONDS, fl::FL_NO_EXCEPT, hue, leds, fl::millis(), fl::Fx::mNumLeds, nextPattern(), runPattern(), and start_time.

+ Here is the call graph for this function: