void setup() {
// put your setup code here, to run once:
pinMode(3, INPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(8, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int sw3=digitalRead(3);
int sw8=digitalRead(8);
if (sw8==HIGH){
for (int A=0;A<2;A++){
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(500);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(500);
}
}
else if (sw3==HIGH){
for (int B=0;B<2;B++){
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(500);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(500);
}
digitalWrite(4, LOW);
delay(500);
digitalWrite(5, HIGH);
delay(500);
}
else (sw8==LOW&&sw3==LOW);{
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
delay(500);
}
}