import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico W!")
from machine import Pin,PWM
from utime import sleep
from random import randint
Led_R = PWM(Pin(2))
Led_G = PWM(Pin(3))
Led_B = PWM(Pin(4))
# Define the frequency
Led_R.freq(2000)
Led_G.freq(2000)
Led_B.freq(2000)
if __name__ == "__main__":
while True:
# range of random numbers
R=randint(0,65535)
G=randint(0,65535)
B=randint(0,65535)
print(R,G,B)
Led_R.duty_u16(R)
Led_G.duty_u16(G)
Led_B.duty_u16(B)
sleep(1)
Loading
pi-pico-w
pi-pico-w