#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 10
// For led chips like Neopixels, 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
#define DATA_PIN 3
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}
void loop()
{
// set the colours
for (int cnt = 0; cnt < 5; cnt++)
{
leds[cnt] = CRGB::Red;
}
for (int cnt = 5; cnt < 10; cnt++)
{
leds[cnt] = CRGB::Blue;
}
// and show
FastLED.show();
delay(500);
// clear the strip
for (int cnt = 0; cnt < 10; cnt++)
{
leds[cnt] = CRGB::Black;
}
FastLED.show();
delay(500);
}