| 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 | |