Hello, i have a problem with my program , the base program is this :
void loop(){
if (digitalRead(pinCapteur) == HIGH) {
digitalWrite(vert, LOW);
digitalWrite(orange, HIGH);
delay(4000);
digitalWrite(orange, LOW);
digitalWrite(rouge, HIGH);
delay(20000);
}
else {
digitalWrite(vert, HIGH);
digitalWrite(orange, LOW);
digitalWrite(rouge, LOW);
}
delay(10);
}
and it's working perfectly, but when i add the 2nd part like that :
void loop(){
if (digitalRead(pinCapteur) == HIGH) {
digitalWrite(vert, LOW);
digitalWrite(orange, HIGH);
delay(4000);
digitalWrite(orange, LOW);
digitalWrite(rouge, HIGH);
delay(20000);
}
else if (digitalRead(bouton) == HIGH) {
delay(20000);
digitalWrite(ledv, HIGH);
digitalWrite(ledr, LOW);
delay(15000);
digitalWrite(ledv, LOW);
digitalWrite(ledr, HIGH);
}
else {
digitalWrite(vert, HIGH);
digitalWrite(orange, LOW);
digitalWrite(rouge, LOW);
digitalWrite(ledv, LOW);
digitalWrite(ledr, HIGH);
}
delay(10);
}
it's not working and everything is broken , even with only an if it is not working , im not pro at arduino and i need your help for this thanks
(The program just making light up LEDs with a button press)
