10FASTLED_SMART_PTR(NoiseWave);
15 :
Fx1d(num_leds), noiseGeneratorRed(500, 14),
16 noiseGeneratorBlue(500, 10) {}
19 if (context.leds ==
nullptr || mNumLeds == 0) {
22 if (start_time == 0) {
23 start_time = context.now;
26 unsigned long time_now = millis() - start_time;
28 for (int32_t i = 0; i < mNumLeds; ++i) {
29 int r = noiseGeneratorRed.LedValue(i, time_now);
30 int b = noiseGeneratorBlue.LedValue(i, time_now + 100000) >> 1;
32 context.leds[i] =
CRGB(r, g, b);
36 fl::Str fxName()
const override {
return "NoiseWave"; }
41 uint32_t start_time = 0;
central include file for FastLED, defines the CFastLED class/object
void draw(DrawContext context) override
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Noise generation classes.
Representation of an RGB pixel (Red, Green, Blue)