# 02 Button and LED
# 04/05/2022
# Mr Anderson

import machine
import utime

button = machine.Pin(4, machine.Pin.IN, machine.Pin.PULL_UP)
led_external = machine.Pin(28,machine.Pin.OUT)

while True:
    if not button.value():
        print('Button pressed!')
        led_external.value(1)
        utime.sleep(0.5)
        led_external.value(0)

BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT