/// @file Blink.ino
/// @brief Blink the first LED of an LED strip
/// @example Blink.ino
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 16
// 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 3
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
}
int ledcnt=0;
void loop() {
if (ledcnt>15) { ledcnt=1;}
// Turn the LED on, then pause
leds[0] = CRGB::GreenYellow;
leds[ledcnt]= CRGB::Amethyst;
leds[ledcnt-1]= CRGB(199, 173, 224);
leds[ledcnt-2]= CRGB(236, 227, 245);
FastLED.show();
delay(50);
// Now turn the LED off, then pause
leds[0] = CRGB(217, 42, 42);
//leds[ledcnt]= CRGB::BlanchedAlmond;
leds[ledcnt]= CRGB::Black;
leds[ledcnt-1]= CRGB::Black;
leds[ledcnt-2]= CRGB::Black;
FastLED.show();
delay(5);
ledcnt++;
}