Many excuses - but I could not refrain...
This loop will also work
void loop() {
digitalWrite(ledPin, ! digitalRead(buttonPin));
}
Many excuses - but I could not refrain...
This loop will also work
void loop() {
digitalWrite(ledPin, ! digitalRead(buttonPin));
}