from machine import Pin,PWM,ADC
from utime import sleep
ldr=ADC(28)
pwm=PWM(Pin(15))
print("hello, pi pico!")
pwm.freq(1000)
while True:
value=ldr.read_u16()
print(value)
pwm.duty_u16(value) #pulse width modulation
if value<5000:
print("low")
sleep(0.001)
elif value>5000:
print("better")
sleep(0.001)