実験 ADC→PWM→LED @Pico,Thonny,Lubuntu22.04

実験 ADC→PWM→LED @Pico,Thonny,Lubuntu22.04

★2209032109 ADC PWM LED.py
import machine,time
PWM= machine.PWM(machine.Pin(25))
PWM.freq(10) #Hz
AD= machine.ADC(0)
while 1:
time.sleep(0.1)
V= AD.read_u16()
PWM.duty_u16(V)
print(V)