#include <FastLED.h>
#define LED_1_PIN 8
#define LED_2_PIN 7
#define LED_1 1
#define LED_2 1
CRGB led1[LED_1];
CRGB led2[LED_2];
//***********************************************************************\\
//READ ME!!! READ ME!!! READ ME!!! READ ME!!! READ ME!!! READ ME!!! READ ME!!!
//Warning: If you change the colors the code might need to be fixed
//You can make it slower if you change the duration var
//()CRGB(150, 150, 150) //this is white
//()CRGB(200, 150, 10) //this is brown
//************************************************************************\\
int OG_White_1 = 150; //How much RED
int OG_White_2 = 150; //How much GREEN
int OG_White_3 = 150; //How much BLUE
int OG_Brown_1 = 200; //How much RED
int OG_Brown_2 = 150; //How much GREEN
int OG_Brown_3 = 10; //How much BLUE
int White_1 = 0; //these set up things later
int White_2 = 0; //these set up things later
int White_3 = 0; //these set up things later
int Brown_1 = 0; //these set up things later
int Brown_2 = 0; //these set up things later
int Brown_3 = 0; //these set up things later
int duration = 9; //change this
//(every 10 is a second)
//(There is also 1.1 extra second)
int diff_change = 0; // don't change this
int color_change = 0; // don't change this
int change = 0; // don't change this
void setup () {
FastLED.addLeds<WS2812, LED_1_PIN, GRB>(led1,LED_1);
FastLED.addLeds<WS2812, LED_2_PIN, GRB>(led2,LED_2);
}
void loop() {
White_1 = OG_White_1 - change;
White_2 = OG_White_2 - change;
White_3 = OG_White_3 - change;
Brown_1 = OG_Brown_1 - change*4/3;
Brown_2 = OG_Brown_2 - change;
Brown_3 = OG_Brown_3 - change/15;
if(color_change == 0){
if(diff_change == 0){
change = change + 1;
}
if(diff_change == 1){
change = change - 1;
}
led1[0] = CRGB(White_1,White_2,White_3); //White
led2[0] = CRGB(White_1,White_2,White_3); //White
FastLED.show();
if(change == 150){
diff_change = 1;
color_change = 1;
}
if(change == 1){
diff_change = 0;
}
}
if(color_change == 1){
if(diff_change == 0){
change = change + 1;
}
if(diff_change == 1){
change = change - 1;
}
led1[0] = CRGB(Brown_1,Brown_2,Brown_3); //Brown
led2[0] = CRGB(Brown_1,Brown_2,Brown_3); //Brown
FastLED.show();
if(change == 150){
diff_change = 1;
color_change = 0;
}
if(change == 1){
diff_change = 0;
}
}
delay(duration);
}