// Pin definitions const int buttonPin = 27; // The pin where the button is connected const int ledPin = 1; // The pin where the LED is connected void setup() { pinMode(ledPin, OUTPUT); // Initialize the LED pin as an output pinMode(buttonPin, INPUT_PULLUP); // Initialize the button pin as an input with internal pull-up resistor } void loop() { // Read the state of the button int buttonState = digitalRead(buttonPin); // Check if the button is pressed if (buttonState == LOW) { // If the button is pressed, turn on the LED digitalWrite(ledPin, LOW); } else { // If the button is released, turn off the LED digitalWrite(ledPin, HIGH); } }