MCPcopy Create free account
hub / github.com/FastLED/FastLED / draw

Method draw

src/fl/fx/1d/noisewave.h:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 noiseGeneratorBlue(500, 10) {}
15
16 void draw(DrawContext context) override {
17 if (context.leds.empty() || mNumLeds == 0) {
18 return;
19 }
20 if (start_time == 0) {
21 start_time = context.now;
22 }
23
24 unsigned long time_now = fl::millis() - start_time;
25
26 for (i32 i = 0; i < mNumLeds; ++i) {
27 int r = noiseGeneratorRed.LedValue(i, time_now);
28 int b = noiseGeneratorBlue.LedValue(i, time_now + 100000) >> 1;
29 int g = 0;
30 context.leds[i] = CRGB(r, g, b);
31 }
32 }
33
34 fl::string fxName() const override { return "NoiseWave"; }
35

Callers

nothing calls this directly

Calls 4

LedValueMethod · 0.80
millisFunction · 0.50
CRGBClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected