int ledPin = 9;
int buttonPin = 11;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(buttonPin) == LOW)
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}