int LED=4;
int BUTTON =7;
void setup() {
pinMode(LED, OUTPUT); // put your setup code here, to run once:
pinMode(BUTTON, INPUT_PULLUP);
}
void loop() {
int State=digitalRead(BUTTON); // put your main code here, to run repeatedly
if(State==LOW){
digitalWrite(LED,HIGH);
delay(1000);
digitalWrite(LED,LOW);
delay(1000);
}
else{
digitalWrite(LED,LOW);
}
else (State==LOW);
digitalWrite(LED, LOW);
}