-
-
Save anonymous/8062aaa683c5ec6f3b7d6ae5f2259c92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
const auto NUM_LEDS = 30; | |
CRGB leds[NUM_LEDS]; | |
CRGBSet left(leds, 0, NUM_LEDS/2); | |
CRGBSet right(leds, NUM_LEDS-1, NUM_LEDS/2); | |
void setup() { | |
FastLED.addLeds<WS2812B, 6, GRB>(leds, NUM_LEDS); | |
FastLED.setBrightness(32); | |
FastLED.clear(); | |
} | |
void loop() { | |
for (int i = 0; i < NUM_LEDS/2 - 1; i++) leds[i] = leds[i+1] % 192; | |
left[NUM_LEDS/2 - 1] = random8() < 32 ? CRGB::Red : CRGB::Black; | |
right = left; | |
FastLED.show(); | |
delay(50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment