Skip to content

Instantly share code, notes, and snippets.

/.ino Secret

Created October 22, 2016 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8062aaa683c5ec6f3b7d6ae5f2259c92 to your computer and use it in GitHub Desktop.
Save anonymous/8062aaa683c5ec6f3b7d6ae5f2259c92 to your computer and use it in GitHub Desktop.
#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