#define LED_PIN PA5 // Onboard LED pin
#define BUTTON_PIN PB0 // Push button pin
void setup() {
pinMode(LED_PIN, OUTPUT); // Set LED pin as output
pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input with pull-up resistor
}
void loop() {
if (digitalRead(BUTTON_PIN) == LOW) { // Check if button is pressed
digitalWrite(LED_PIN, HIGH); // Turn LED on
} else {
digitalWrite(LED_PIN, LOW); // Turn LED off
}
}