Skip to content

Instantly share code, notes, and snippets.

@ssysm

ssysm/demo.ino Secret

Created December 21, 2018 02:12
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 ssysm/05f23d7a06026b4853d7ede71c7101ff to your computer and use it in GitHub Desktop.
Save ssysm/05f23d7a06026b4853d7ede71c7101ff to your computer and use it in GitHub Desktop.
#include<FastLED.h>
#define NUM_LEDS 40
CRGBArray<NUM_LEDS> leds;
void setup() { FastLED.addLeds<NEOPIXEL,6>(leds, NUM_LEDS); }
void loop(){
static uint8_t hue;
for(int i = 0; i < NUM_LEDS/2; i++) {
// fade everything out
leds.fadeToBlackBy(40);
// let's set an led value
leds[i] = CHSV(hue++,255,255);
// now, let's first 20 leds to the top 20 leds,
leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0);
FastLED.delay(33);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment