import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
import machine
import utime
# Define GPIO pins for the switch and LED
switch_pin = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_DOWN)
led_pin = machine.Pin(15, machine.Pin.OUT)
# Set the time delay in seconds
delay_time = 2 # Adjust this as needed
while True:
if switch_pin.value() == 1: # Check if the switch is pressed
led_pin.value(1) # Turn on the LED
utime.sleep(delay_time) # Wait for the specified delay
led_pin.value(0) # Turn off the LED