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