FastLED 3.9.15
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 22 of file demoreel100.h.

22 {
23 fl::span<CRGB> leds = context.leds;
24 if (leds.empty() || mNumLeds == 0) {
25 return;
26 }
27 if (start_time == 0) {
29 }
30
31 // Call the current pattern function once, updating the 'leds' array
33
34 // do some periodic updates
36 hue++;
37 } // slowly cycle the "base color" through the rainbow
38 EVERY_N_SECONDS(10) { nextPattern(); } // change patterns periodically
39 }
fl::CRGB leds[NUM_LEDS]
void runPattern(fl::span< CRGB > leds)
Definition demoreel100.h:54
unsigned long start_time
Definition demoreel100.h:46
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()
Universal millisecond timer - returns milliseconds since system startup.

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

+ Here is the call graph for this function: