Hi folks:
I've searched this one and there are several posts, but the solutions don't speak to my issue. Ii have four LEDs on a project board with a resistor on each positive lead. I have the cathode pins on the ground strip - common ground jumper to GND on the Arduino Uno.
So, with that in mind, I fire up the following code - it starts working great, but when I turn off the LEDs, the first one (LED1) does NOT turn off. I've tried several things - different pinouts, etc., but it won't turn off. PLEASE!!! Have a look and help me if you see an issue:
//#define LED0 GND
#define LED1 A0
#define LED2 A1
#define LED3 A2
#define LED4 A3
void setup() {
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED1,1);
delay(1000);
digitalWrite(LED2,1);
delay(1000);
digitalWrite(LED3,1);
delay(1000);
digitalWrite(LED4,1);
delay(1000);
digitalWrite(LED4,0);
digitalWrite(LED3,0);
digitalWrite(LED2,0);
digitalWrite(LED1,0);
}