| 12 | CRGB current_color = CRGB::Black; |
| 13 | |
| 14 | void setup() { |
| 15 | FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); |
| 16 | FastLED.setBrightness(16); |
| 17 | |
| 18 | // Create a task that runs every 100ms to change color |
| 19 | auto colorPicker = fl::task::every_ms(100, FL_TRACE) |
| 20 | .then([] { |
| 21 | current_color = CHSV(random8(), 255, 255); |
| 22 | }); |
| 23 | |
| 24 | // Create a task that runs at 60fps to update the LEDs |
| 25 | auto displayTask = fl::task::at_framerate(60, FL_TRACE) |
| 26 | .then([] { |
| 27 | fill_solid(leds, NUM_LEDS, current_color); |
| 28 | FastLED.show(); |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | void loop() { |
| 33 | // Yield to allow other operations to run |
nothing calls this directly
no test coverage detected