const int led1 = 13;
const int led2 = 12;
const int pushButton = 11;
bool val = false;
void setup() {
pinMode (led1, OUTPUT);
pinMode (led2, OUTPUT);
pinMode (pushButton, INPUT);
}
void loop() {
val = digitalRead(pushButton);
if(val == true){
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
}
else{
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
}
delay(100);
}