from machine import Pin
from utime import sleep_ms
from utime import sleep
button = Pin(5, Pin.IN, Pin.PULL_UP) #Internal pull-up
led = Pin(6, Pin.OUT)
led_on = False
while True:
print(button.value())
if button.value() == 0: #key press
led_on = True
sleep_ms(200)
if led_on == True:
#led.on()
led.toggle()
sleep(2)
pico1:GP0
pico1:GP1
pico1:GND.1
pico1:GP2
pico1:GP3
pico1:GP4
pico1:GP5
pico1:GND.2
pico1:GP6
pico1:GP7
pico1:GP8
pico1:GP9
pico1:GND.3
pico1:GP10
pico1:GP11
pico1:GP12
pico1:GP13
pico1:GND.4
pico1:GP14
pico1:GP15
pico1:GP16
pico1:GP17
pico1:GND.5
pico1:GP18
pico1:GP19
pico1:GP20
pico1:GP21
pico1:GND.6
pico1:GP22
pico1:RUN
pico1:GP26
pico1:GP27
pico1:GND.7
pico1:GP28
pico1:ADC_VREF
pico1:3V3
pico1:3V3_EN
pico1:GND.8
pico1:VSYS
pico1:VBUS
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
r1:1
r1:2
led1:A
led1:C