#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 12
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 2
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
}
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Yellow;
FastLED.show();
leds[1] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[2] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[3] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[4] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[5] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[6] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[7] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[8] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[9] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[10] = CRGB::Yellow;
delay(20);
FastLED.show();
leds[11] = CRGB::Yellow;
delay(20);
FastLED.show();
delay(400);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
delay(20);
FastLED.show();
leds[1] = CRGB::Black;
delay(20);
FastLED.show();
leds[2] = CRGB::Black;
delay(20);
FastLED.show();
leds[3] = CRGB::Black;
delay(20);
FastLED.show();
leds[4] = CRGB::Black;
delay(20);
FastLED.show();
leds[5] = CRGB::Black;
delay(20);
FastLED.show();
leds[6] = CRGB::Black;
delay(20);
FastLED.show();
leds[7] = CRGB::Black;
delay(20);
FastLED.show();
leds[8] = CRGB::Black;
delay(20);
FastLED.show();
leds[9] = CRGB::Black;
delay(20);
FastLED.show();
leds[10] = CRGB::Black;
delay(20);
FastLED.show();
leds[11] = CRGB::Black;
delay(20);
FastLED.show();
delay(400);
}