from machine import Pin
import time
# Replace 17 with your actual LED pin number
led_pin = 17
# Set LED pin as output
led = Pin(led_pin, Pin.OUT)
try:
print("Press Ctrl+C to stop blinking")
while True:
led.value(1) # Turn LED on (value can also be True)
time.sleep(1)
led.value(0) # Turn LED off (value can also be False)
time.sleep(1)
# Clean up GPIO on exit (optional)
except KeyboardInterrupt:
print("Cleaning up...")
led.value(0) # Turn off LED before exiting