void loop() {
switchState=digitalRead(5);
if (switchState==LOW){
digitalWrite(2,HIGH); //Green LED
digitalWrite(3,LOW); //Red1 LED
digitalWrite(4,LOW); //Red2 LED
}
else {
digitalWrite(2,LOW);//Green LED
digitalWrite(3,HIGH); //Red1 LED
digitalWrite(4,HIGH);//Red2 LED
delay(1000);
digitalWrite(3 HIGH);
digitalWrite(4,LOW);
delay(1000);
}
Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).
Also this post is NOT an introductory tutorial so I moved it to a more suitable place. Please pay attention to the stickies.
Thanks in advance for editing and fixing your post.