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 24 of file demoreel100.h.

24 {
25 CRGB *leds = context.leds;
26 if (leds == nullptr || mNumLeds == 0) {
27 return;
28 }
29 if (start_time == 0) {
30 start_time = millis();
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[NUM_LEDS]
Definition Apa102.ino:11
void runPattern(CRGB *leds)
Definition demoreel100.h:56
unsigned long start_time
Definition demoreel100.h:48
uint16_t mNumLeds
Definition fx.h:53
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1341
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Definition lib8tion.h:1306

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

+ Here is the call graph for this function: