const int BUTTON_PIN=7;
const int LED_PIN=8;
int buttonState=0;
void setup() {
// put your setup code here, to run once:
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState=digitalRead(BUTTON_PIN);
if(buttonState==LOW)
digitalWrite(LED_PIN, HIGH);
else{
digitalWrite(LED_PIN, LOW);
}
}