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

26 {
27 CRGB *leds = context.leds;
28 if (leds == nullptr || mNumLeds == 0) {
29 return;
30 }
31 if (start_time == 0) {
32 start_time = millis();
33 }
34
35 // Call the current pattern function once, updating the 'leds' array
37
38 // do some periodic updates
40 hue++;
41 } // slowly cycle the "base color" through the rainbow
42 EVERY_N_SECONDS(10) { nextPattern(); } // change patterns periodically
43 }
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
void runPattern(CRGB *leds)
Definition demoreel100.h:58
unsigned long start_time
Definition demoreel100.h:50
uint16_t mNumLeds
Definition fx.h:50
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1359
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Definition lib8tion.h:1324

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: