from machine import Pin,PWM
from utime import sleep
PIR = Pin(0, Pin.IN, Pin.PULL_DOWN)
Led_R = PWM(Pin(2))
Led_G = PWM(Pin(3))
Led_B = PWM(Pin(4))
Led_R.freq(2000)
Led_G.freq(2000)
Led_B.freq(2000)
if __name__ == '__main__':
    while True:
        print(PIR.value())
        if PIR.value() == 1:
            Led_R.duty_u16(65535)
            Led_G.duty_u16(65535)
            Led_B.duty_u16(65535)
            sleep(3)
        else:
            Led_R.duty_u16(0)
            Led_G.duty_u16(0)
            Led_B.duty_u16(0)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT