from machine import Pin
from utime import sleep
btn = Pin(12, Pin.IN, Pin.PULL_UP)
LedR = Pin(1, Pin.OUT)
LedY = Pin(2, Pin.OUT)
LedG = Pin(4, Pin.OUT)
while True:
LedR.on()
sleep(0.1)
if btn.value() == 0:
LedR.off()
LedY.on()
sleep(1)
LedY.off()
LedG.on()
sleep(2)
LedG.off()
Loading
pi-pico-w
pi-pico-w