//Leds chase backwards and forwards along strip
#include <FastLED.h>
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS 60
#define DATA_PIN 5
#define BRIGHTNESS 96
CRGB leds[NUM_LEDS];
unsigned long delayPeriod = 50;
void setup() {
delay(2000);
//FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); // GRB ordering is typical
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Red;
leds[dot+5] = CRGB::Black;
leds[dot+10] = CRGB::Yellow;
leds[dot+15] = CRGB::Black;
leds[dot+20] = CRGB::Green;
leds[dot+25] = CRGB::Black;
leds[dot+30] = CRGB::Aqua;
leds[dot+35] = CRGB::Black;
leds[dot+40] = CRGB::Magenta;
leds[dot+45] = CRGB::Blue;
//leds[dot] = leds[10];
FastLED.show();
leds[dot-4] = CRGB::Black;
//fadeToBlackBy( leds, NUM_LEDS, 100);
delay(delayPeriod);
}
}