I'm currently trying to write a code for an Arduino Uno. I have four (4) rows of six (6) LED lights, and I am trying to get them to run by themselves on a counter. Below is my coding, but I have run into an issue where the lights turn on but will not turn off. I am currently using TinkerCad to try and troubleshoot. Although the code addresses all four (4) rows of lights, I have only coded for one in the void loop(). Any advice is helpful!
// Test for board
int LEDblue = 13;
int LEDblueON = 1000;
int LEDblueOFF = 1000;
int LEDgreen = 12;
int LEDgreenON = 2000;
int LEDgreenOFF = 2000;
int LEDyellow = 11;
int LEDyellowON = 4000;
int LEDyellowOFF = 4000;
int LEDred = 10;
int LEDredON = 8000;
int LEDredOFF = 8000;
int CounterBlue = 0;
int CounterGreen = 0;
int CounterYellow = 0;
int CounterRed = 0;
void setup()
{
pinMode (LEDblue, OUTPUT);
pinMode (LEDgreen, OUTPUT);
pinMode (LEDyellow, OUTPUT);
pinMode (LEDred, OUTPUT);
}
void loop()
{
if (CounterBlue <LEDblueON);
{
digitalWrite(LEDblue, HIGH);
}
if (CounterBlue=LEDblueON+LEDblueOFF);
{
digitalWrite(LEDblue, LOW);
}
if(CounterBlue>LEDblueON+LEDblueOFF);
{
(CounterBlue= 0);
}
delay(1);
}