"""
from machine import Pin
from time import sleep
led_13 = Pin(13,Pin.OUT)
led_12 = Pin(12,Pin.OUT)
led_14 = Pin(14,Pin.OUT)
while True:
led_12.value(1)
led_13.value(0)
led_14.value(0)
sleep(0.5)
led_12.value(0)
led_13.value(1)
led_14.value(0)
sleep(0.5)
led_12.value(0)
led_13.value(0)
led_14.value(1)
sleep(0.5)
"""
from machine import Pin
from utime import sleep_ms
button = Pin(0,Pin.IN,Pin.PULL_UP) #Internal pull-up
button = Pin(1,Pin.IN,Pin.PULL_UP) #Internal pull-up
button = Pin(2,Pin.IN,Pin.PULL_UP) #Internal pull-up
led = Pin(0, Pin.OUT)
led = Pin(1, Pin.OUT)
led = Pin(2, Pin.OUT)
state=0 #0 means that the light is currently off
if __name__=='__main__':
while True:
print(button.value())
if button.value()==0:
if state==0:
led.value(1)
sleep_ms=100
while button.value()==0:
State=1
else:
led.value(0)
sleep_ms=100
while button.value()==0:
State=0
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
led1:A
led1:C
led2:A
led2:C
led3:A
led3:C
r1:1
r1:2
r2:1
r2:2
r3:1
r3:2
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
btn2:1.l
btn2:2.l
btn2:1.r
btn2:2.r
btn4:1.l
btn4:2.l
btn4:1.r
btn4:2.r