const int buttonPin = 3;
const int ledPin = 5;
int buttonState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
pinMode(buttonPin, INPUT);
buttonState = LOW;
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(buttonPin) == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}