#include <FastLED.h> //FastLed library version 3.2.1 - https://github.com/FastLED/FastLED/wiki/Overview or http://fastled.io/ with NEOPIXEL or WS2812B
#define NUM_STRIPS 2 // number of led strips (in this example are front left and front right)
#define NUM_LEDS_PER_STRIP 20 // number of leds per each strip
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
//char Incoming_value = 0;
const int buttonPinL = 2; // turn left
const int buttonPinR = 3; // turn right
const int buttonPinEng = 4; // engine on to start day lights
const int buttonPinKnightRider = 6; // knight rider lights
int buttonStateL = 0;
int buttonStateR = 0;
int engineOn = 0;
int KnightRiderState = 0;
int stateL = 0;
int stateR = 0;
uint8_t gBrtL = 0;
uint8_t gBrtR = 0;
int maxBrt = 120; // maxim brightness day lights - from 0 to 255
bool initialized = false;
bool BTSw = false;
bool Effects = false;
bool OutEff = false;
int delayTurnLedAnim = 25; //delay of each led in turn light animation
int delayTurnLedOff = 250; //delay from animation to black (is used twice)
int delayLedToDayLight = 500; // delay from animation to day light on
int nrAnimAfterOff = 1; // number of animations for a single impulse
float delta;
uint8_t count = 0;
// Mess with these values for fill speed and slowing effect.
uint8_t fill_delay = 10; // Increase to slow fill rate.
uint8_t fill2_delay = 35; // Increase to slow fill rate.
float delay_base = 1.17; // Used to add a delay as strip fills up.
float delay_multiplier = 2.15; // Used to add a delay as strip fills up.
/* Set delays to 1.0 if you don't want any slowing. These numbers need to
be tuned visually based on your preference and also based on the number
of pixels in your strip.
These values looked good to me with a 32 pixel strip. Small changes can
make a large difference so try small increments.
*/
int mode = 2; //1 = Half strip light / 2= full strip light
void setup() {
Serial.begin(9600);
pinMode(buttonPinL, INPUT);
pinMode(buttonPinR, INPUT);
pinMode(buttonPinEng, INPUT);
pinMode(buttonPinKnightRider, INPUT);
FastLED.addLeds<NEOPIXEL, 8>(leds[0], NUM_LEDS_PER_STRIP); //led strip for front left
FastLED.addLeds<NEOPIXEL, 9>(leds[1], NUM_LEDS_PER_STRIP); //led strip for front right
attachInterrupt(digitalPinToInterrupt(buttonPinL),btnPressL,RISING); // we use interrupt for instant reaction of turn lights
attachInterrupt(digitalPinToInterrupt(buttonPinR),btnPressR,RISING); // we use interrupt for instant reaction of turn lights
FastLED.setMaxPowerInVoltsAndMilliamps(5, 1500); // Set power limit of LED strip to 5V, 1500mA
FastLED.clear(); // Initialize all LEDs to "OFF"
//fill_solid(leds[0], NUM_LEDS_PER_STRIP, CRGB::Black); // some led strips are all on at power on, so let's power them off at boot
//fill_solid(leds[1], NUM_LEDS_PER_STRIP, CRGB::Black); // some led strips are all on at power on, so let's power them off at boot
FastLED.show();
}
void loop() {
// read the input state
//Serial.begin(9600);
buttonStateL = digitalRead(buttonPinL);
buttonStateR = digitalRead(buttonPinR);
KnightRiderState = digitalRead(buttonPinKnightRider);
EVERY_N_MILLISECONDS( 1 ){
engineOn = digitalRead(buttonPinEng);
}
initilize();
/*while (Serial.available()) //Send data only when you receive data
{
BTSw = true;
Effect('OFFEffect');
OutEff = false;
delay(4); //delay time
char c = Serial.read();
readString += c;
}
if (readString.length() > 0)
{
if(readString == "offeff") {
if(BTSw == true){
BTSw = false;
Out();
}
fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.clear();
FastLED.show();
}
if(readString == "rainbow") {
Effect('A');
}
if(readString == "rainbow2"){
Effect('B');
}
if(readString == "commet"){
Effect('C');
}
if(readString == "sparkle"){
Effect('D');
}
if(readString == "knrider"){
Effect('E');
}
if(readString == "rainbowchase"){
Effect('F');
}
if(readString == "red"){ //rosu
//setColor(250, 0, 0);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(250, 0, 0));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(250, 0, 0));
FastLED.show();
}
if(readString == "green"){ //verde
//setColor(0, 250, 0);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(0, 250, 0));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(0, 250, 0));
FastLED.show();
}
if(readString == "blue"){ //albastru
//setColor(0, 0, 250);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(0, 0, 250));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(0, 0, 250));
FastLED.show();
}
if(readString == "yellow"){ //galben
//setColor(250, 250, 0);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(250, 250, 0));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(250, 250, 0));
FastLED.show();
}
if(readString == "pink"){ //roz
//setColor(250, 55, 120);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(250, 55, 120));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(250, 55, 120));
FastLED.show();
}
if(readString == "magenta"){ //violet
//setColor(143, 2, 250);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(140, 0, 250));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(140, 0, 250));
FastLED.show();
}
if(readString == "cyan"){ //cyan
//setColor(2, 246, 250);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(0, 250, 250));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(0, 250, 250));
FastLED.show();
}
if(readString == "turq"){ //turquoise
//setColor(2, 250, 171);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(64, 224, 208));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(64, 224, 208));
FastLED.show();
}
if(readString == "orange"){ //orange
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CHSV(250, 118, 0));
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CHSV(250, 118, 0));
FastLED.show();
}
readString = "";
}
/*
//if(Serial.available() <= 0 && Incoming_value == 'BTBTConnectOFF' ){
if(BTSw == true){
BTSw = false;
Out();
}
//}
}*/
if(KnightRiderState == LOW){
if(BTSw == true){
BTSw = false;
Out();
}
}
if(KnightRiderState == HIGH){
BTSw = true;
Effect('OFFEffect');
OutEff = false;
}
if(BTSw == false){
//function for hazard lights
if(stateL != 0 && stateR != 0){
for(int dot = 0; dot < NUM_LEDS_PER_STRIP; dot++) {
leds[0][dot] = 0xff6a00; // color for left turn light
leds[1][dot] = 0xff6a00; // color for right turn light
FastLED.show();
delay(delayTurnLedAnim);
}
delay(delayTurnLedOff);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
delay(delayTurnLedOff);
if(buttonStateL != HIGH || buttonStateR != HIGH){
if(buttonStateL == HIGH){
stateL = 1;
}else{
stateL = 0;
gBrtL = 0;
}
if(buttonStateR == HIGH){
stateR = 1;
}else{
stateR = 0;
gBrtR = 0;
}
if(buttonStateL != HIGH && buttonStateR != HIGH){
delay(delayLedToDayLight);
}
}
//function for left turn lights
}else if(stateL != 0){
if(engineOn == LOW){
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
}
for(int dot = 0; dot < NUM_LEDS_PER_STRIP; dot++) {
leds[0][dot] = 0xff6a00; // color for left turn light
FastLED.show();
delay(delayTurnLedAnim);
}
delay(delayTurnLedOff);
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
delay(delayTurnLedOff);
stateL++;
if(stateL >= nrAnimAfterOff && buttonStateL != HIGH){
stateL = 0;
gBrtL = 0;
delay(delayLedToDayLight);
}
//function for right turn lights
}else if(stateR != 0){
if(engineOn == LOW){
fill_solid(leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
}
for(int dot = 0; dot < NUM_LEDS_PER_STRIP; dot++) {
leds[1][dot] = 0xff6a00; // color for right turn light
FastLED.show();
delay(delayTurnLedAnim);
}
delay(delayTurnLedOff);
fill_solid(leds[1], NUM_LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
delay(delayTurnLedOff);
stateR++;
if(stateR >= nrAnimAfterOff && buttonStateR != HIGH){
stateR = 0;
gBrtR = 0;
delay(delayLedToDayLight);
}
}else{
switch (mode)
{
case 1:
mode1();
break;
case 2:
mode2();
break;
default:
mode1();
break;
}
// left side drl
/*if(stateL == 0 && engineOn == HIGH){
if(gBrtL <= maxBrt){
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtL++; }
leds[0][dot] = CHSV(0,0,gBrtL);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[0][dot] = CRGB::Black;
FastLED.show();
}
}
}else{
if(gBrtL > 0){
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtL--; }
leds[0][dot] = CHSV(0,0,gBrtL);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[0][dot] = CRGB::Black;
FastLED.show();
}
}
}*/
//right side drl
/*if(stateR == 0 && engineOn == HIGH){
if(gBrtR <= maxBrt){
EVERY_N_MILLISECONDS( 1 ) { gBrtR++; }
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtR));
FastLED.show();
}
}else{
if(gBrtR > 0){
EVERY_N_MILLISECONDS( 1 ) { gBrtR--; }
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtR));
FastLED.show();
}
}*/
}
}else{
if(BTSw == true){
FastLED.clear();
FastLED.show();
}
}
}
void initilize(){
if (initialized == false) {
initialized = true;
_animUP();
}
}
void Effect(char aValue){
if(Effects == false){
Effects == true;
switch (aValue) {
case 'OFF' : {
FastLED.setMaxRefreshRate(0);
FastLED.clear();
break;
}
case 'A': {
FastLED.setMaxRefreshRate(0);
_rainbowCycle(10);
break;
}
case 'B': {
FastLED.setMaxRefreshRate(0);
_CylonBounce(0xff, 0, 0, 2, 20, 50);
break;
}
case 'C': {
FastLED.setMaxRefreshRate(0);
_RunningLights(0xff,0xff,0x00, 50);
FastLED.show();
break;
}
case 'D': {
FastLED.setMaxRefreshRate(0);
_theaterChase(0xff,0,0,50);
FastLED.show();
break;
}
case 'E': {
FastLED.setMaxRefreshRate(0);
_meteorRain(0xff,0xff,0xff,10, 64, true, 30);
FastLED.show();
break;
}
case 'F': {
FastLED.setMaxRefreshRate(0);
_chaserainbow();
FastLED.show();
break;
}
case 'OFFEffect': {
break;
}
/*case 'G': {
FastLED.setMaxRefreshRate(0);
shootingStarAnimation(random(0, 255), random(0, 255), random(0, 255), 50, 60, 2000, 1);
FastLED.show();
break;
}*/
}
}
}
void _rainbowCycle(int SpeedDelay) {
byte *c;
uint16_t i, j;
FastLED.setMaxRefreshRate(0);
for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< NUM_LEDS_PER_STRIP; i++) {
c=Wheel(((i * 256 / NUM_LEDS_PER_STRIP) + j) & 255);
setPixel(i, *c, *(c+1), *(c+2));
}
showStrip();
delay(SpeedDelay);
}
}
byte * Wheel(byte WheelPos) {
static byte c[3];
if(WheelPos < 85) {
c[0]=WheelPos * 3;
c[1]=255 - WheelPos * 3;
c[2]=0;
} else if(WheelPos < 170) {
WheelPos -= 85;
c[0]=255 - WheelPos * 3;
c[1]=0;
c[2]=WheelPos * 3;
} else {
WheelPos -= 170;
c[0]=0;
c[1]=WheelPos * 3;
c[2]=255 - WheelPos * 3;
}
return c;
}
void Out(){
if(OutEff == false){
OutEff == true;
_FadeInOut(0xff, 0xff, 0xff);
}
}
void _FadeInOut(byte red, byte green, byte blue){
for(int i=0;i<256;i=i+10) {
for(int j=0;j<NUM_LEDS_PER_STRIP;j++) {
FastLED.setBrightness(i);
fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,120));
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CHSV(0,0,120));
FastLED.show();
}
}
}
void _animUP(){
for(int dot = 0; dot < NUM_LEDS_PER_STRIP; dot++) {
// color for led strip effect
//fadeToBlackBy(leds[0], NUM_LEDS_PER_STRIP, 100);
leds[0][dot] = CHSV(0,0,120);
leds[1][dot] = CHSV(0,0,120);
FastLED.show();
delay(50);
}
for(int dot = NUM_LEDS_PER_STRIP-1; dot >= 0; dot--) {
leds[0][dot] = CHSV(0,0,255);
leds[1][dot] = CHSV(0,0,255);
FastLED.show();
delay(50); // Slow things down just a bit.
}
/*for(int dot = 0; dot < NUM_LEDS_PER_STRIP; dot++) {
// color for led strip effect
//fadeToBlackBy(leds[0], NUM_LEDS_PER_STRIP, 100);
leds[0][dot] = CHSV(0,0,120);
leds[1][dot] = CHSV(0,0,120);
FastLED.show();
delay(fill2_delay);
}
for(int dot = NUM_LEDS_PER_STRIP-1; dot >= 0; dot--) {
for (int i=0; i < (NUM_LEDS_PER_STRIP - count); i++){
leds[0][i] = CHSV(0,0,255);
leds[1][i] = CHSV(0,0,255);
FastLED.show();
delay(fill_delay); // Slow things down just a bit.
leds[0][i] = CHSV(0,0,120);
leds[1][i] = CHSV(0,0,120);
}
// Add the new filled pixels.
leds[0][NUM_LEDS_PER_STRIP - 1 - count] = CHSV(0,0,255);
leds[1][NUM_LEDS_PER_STRIP - 1 - count] = CHSV(0,0,255);
FastLED.show();
count++;
// Delay the filling effect to slow near end.
delta = (pow(delay_base, count) * delay_multiplier); // Delta increases as strip fills up.
delay(delta); // Delay can increase as strip fills up.
}*/
}
void btnPressL(){
stateL = 1;
for(int nr = 0; nr < 1500; nr++) {
buttonStateR = digitalRead(buttonPinR);
if(buttonStateR == 1){
stateR = 1;
}
}
}
void btnPressR(){
stateR = 1;
for(int nr = 0; nr < 1500; nr++) {
buttonStateL = digitalRead(buttonPinL);
if(buttonStateL == 1){
stateL = 1;
}
}
}
void _RunningLights(byte red, byte green, byte blue, int WaveDelay) {
int Position=0;
for(int j=0; j<NUM_LEDS_PER_STRIP*2; j++)
{
Position++; // = 0; //Position + Rate;
for(int i=0; i<NUM_LEDS_PER_STRIP; i++) {
// sine wave, 3 offset waves make a rainbow!
//float level = sin(i+Position) * 127 + 128;
//setPixel(i,level,0,0);
//float level = sin(i+Position) * 127 + 128;
setPixel(i,((sin(i+Position) * 127 + 128)/255)*red,
((sin(i+Position) * 127 + 128)/255)*green,
((sin(i+Position) * 127 + 128)/255)*blue);
}
showStrip();
delay(50);
}
}
void _CylonBounce(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay){
for(int i = 0; i < NUM_LEDS_PER_STRIP-EyeSize-2; i++) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
for(int i = NUM_LEDS_PER_STRIP-EyeSize-2; i > 0; i--) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
void _theaterChase(byte red, byte green, byte blue, int SpeedDelay) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (int i=0; i < NUM_LEDS_PER_STRIP; i=i+3) {
setPixel(i+q, red, green, blue); //turn every third pixel on
}
showStrip();
delay(SpeedDelay);
for (int i=0; i < NUM_LEDS_PER_STRIP; i=i+3) {
setPixel(i+q, 0,0,0); //turn every third pixel off
}
}
}
}
void _meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
setAll(0,0,0);
for(int i = 0; i < NUM_LEDS_PER_STRIP+NUM_LEDS_PER_STRIP; i++) {
// fade brightness all LEDs one step
for(int j=0; j<NUM_LEDS_PER_STRIP; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
fadeToBlack(j, meteorTrailDecay );
}
}
// draw meteor
for(int j = 0; j < meteorSize; j++) {
if( ( i-j <NUM_LEDS_PER_STRIP) && (i-j>=0) ) {
setPixel(i-j, red, green, blue);
}
}
showStrip();
delay(SpeedDelay);
}
}
void fadeToBlack(int ledNo, byte fadeValue) {
// FastLED
leds[0][ledNo].fadeToBlackBy( fadeValue );
leds[1][ledNo].fadeToBlackBy( fadeValue );
}
void _chaserainbow(){
// Waves for LED position
uint8_t posBeat = beatsin8(30, 0, NUM_LEDS_PER_STRIP - 1, 0, 0);
uint8_t posBeat2 = beatsin8(60, 0, NUM_LEDS_PER_STRIP - 1, 0, 0);
uint8_t posBeat3 = beatsin16(30, 0, NUM_LEDS_PER_STRIP - 1, 0, 127);
uint8_t posBeat4 = beatsin16(60, 0, NUM_LEDS_PER_STRIP - 1, 0, 127);
// Wave for LED color
uint8_t colBeat = beatsin8(45, 0, 255, 0, 0);
leds[0][(posBeat + posBeat2) / 2] = CHSV(colBeat, 255, 255);
leds[0][(posBeat3 + posBeat4) / 2] = CHSV(colBeat, 255, 255);
fadeToBlackBy(leds[0], NUM_LEDS_PER_STRIP, 10);
leds[1][(posBeat + posBeat2) / 2] = CHSV(colBeat, 255, 255);
leds[1][(posBeat3 + posBeat4) / 2] = CHSV(colBeat, 255, 255);
fadeToBlackBy(leds[1], NUM_LEDS_PER_STRIP, 10);
FastLED.show();
}
void showStrip() {
// FastLED
FastLED.show();
}
void setPixel(int Pixel, byte red, byte green, byte blue) {
leds[0][Pixel].r = red;
leds[0][Pixel].g = green;
leds[0][Pixel].b = blue;
leds[1][Pixel].r = red;
leds[1][Pixel].g = green;
leds[1][Pixel].b = blue;
}
void setAll(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}
void mode1() {
if(stateL == 0 && engineOn == HIGH){
if(gBrtL <= maxBrt){
EVERY_N_MILLISECONDS( 1 ) { gBrtL++; }
fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
FastLED.show();
}
}else{
if(gBrtL > 0){
EVERY_N_MILLISECONDS( 1 ) { gBrtL--; }
fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
FastLED.show();
}
}
//right side drl
if(stateR == 0 && engineOn == HIGH){
if(gBrtR <= maxBrt){
EVERY_N_MILLISECONDS( 1 ) { gBrtR++; }
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtR));
FastLED.show();
}
}else{
if(gBrtR > 0){
EVERY_N_MILLISECONDS( 1 ) { gBrtR--; }
fill_solid( leds[1], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtR));
FastLED.show();
}
}
}
void mode2() {
if(stateL == 0 && engineOn == HIGH){
if(gBrtL <= maxBrt){
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtL++; }
leds[0][dot] = CHSV(0,0,gBrtL);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[0][dot] = CRGB::Black;
FastLED.show();
}
}
}else{
if(gBrtL > 0){
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CHSV(0,0,gBrtL));
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtL--; }
leds[0][dot] = CHSV(0,0,gBrtL);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[0][dot] = CRGB::Black;
FastLED.show();
}
}
}
//right side drl
if(stateR == 0 && engineOn == HIGH){
if(gBrtR <= maxBrt){
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtR++; }
leds[1][dot] = CHSV(0,0,gBrtR);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[1][dot] = CRGB::Black;
FastLED.show();
}
}
}else{
if(gBrtR > 0){
for(int dot = 10; dot < NUM_LEDS_PER_STRIP; dot++) {
EVERY_N_MILLISECONDS( 1 ) { gBrtR--; }
leds[1][dot] = CHSV(0,0,gBrtR);
FastLED.show();
}
for(int dot = 0; dot < 10; dot++) {
//fill_solid( leds[0], NUM_LEDS_PER_STRIP, CRGB::Black);
leds[1][dot] = CRGB::Black;
FastLED.show();
}
}
}
}