// Change NUM_LEDS for your LEDS
//Reduce d to speed up
// +5v LED to Vin nano GND and d2 to data in
#include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 16
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
int d = 30;
int r = 0;
int g = 0;
int b = 0;
void loop() {
// put your main code here, to run repeatedly:
for(int i=0; i<255; i+=5){
//leds[0] = CRGB(0,0,i);
// FastLED.show();
//delay(d);
}
for(int i = 255; i>0; i-=5){
//leds[0] = CRGB(i,0,0);
//FastLED.show();
//delay(d);
}
for(int n=0; n<3; n++){
for(int i=0; i<3; i++){
// leds[0] = CRGB(255,0,0);
//FastLED.show();
//delay(d);
//leds[0] = CRGB(0,0,0);
//FastLED.show();
// delay(d);
}
delay(d);
}
r = random(0,255);
g = random(0,255);
b = random(0,255);
for(int n = 0; n<NUM_LEDS; n++){
leds[n] = CRGB(r,g,b);
FastLED.show();
delay(d);
leds[n] = CRGB(0,0,0);
FastLED.show();
delay(d);
}
//r = random(0,255);
//g = random(0,255);
//b = random(0,255);
for(int n = NUM_LEDS; n>=0; n--){
leds[n] = CRGB(r,g,b);
FastLED.show();
delay(d);
leds[n] = CRGB(0,0,0);
FastLED.show();
delay(d);
}
}