Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void lightning(String color, int duration)
- {
- CRGB parsed_color = get_color(color);
- unsigned long timer = millis();
- while (millis() - timer < duration)
- {
- for (int j = 0; j < NUM_LEDS; j++)
- {
- if (random(0, 100) > 50)
- {
- leds[j] = parsed_color;
- } else {
- leds[j] = CRGB::Black;
- }
- }
- FastLED.show();
- delay(random(10, 100));
- turn_off_leds();
- delay(random(10, 100));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement