#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 8
CRGB leds[NUM_LEDS];
int fadeAmount = 55;
int brightness = 0;
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if(brightness == 0 || brightness == 255)
{
fadeAmount = -fadeAmount ;
}
for(int i=0;i<1;i++){
leds[i] = CRGB(255, 252, 252);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=1;i<2;i++){
leds[i] = CRGB(246, 220, 142);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=2;i<3;i++){
leds[i] = CRGB(253, 252, 252);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=3;i<4;i++){
leds[i] = CRGB(246, 220, 142);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if(brightness == 0 || brightness == 255)
{
fadeAmount = -fadeAmount ;
}
for(int i=4;i<5;i++){
leds[i] = CRGB(255, 252, 252);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=5;i<6;i++){
leds[i] = CRGB(246, 220, 142);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=6;i<7;i++){
leds[i] = CRGB(253, 253, 253);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
for(int i=7;i<8;i++){
leds[i] = CRGB(246, 220, 142);
leds[i].fadeLightBy(brightness);
FastLED.show();
delay(100);
}
}