from machine import ADC, PWM, Pin
import utime
s = PWM(Pin(0))
s.freq(50)
abc = ADC(2)
while True:
pot = int(abc.read_u16() * 180 / 65535)
print(pot)
ton = (pot + 45) * 100000 / 9
s.duty_ns(int(ton))
utime.sleep_ms(200)
from machine import ADC, PWM, Pin
import utime
s = PWM(Pin(0))
s.freq(50)
abc = ADC(2)
while True:
pot = int(abc.read_u16() * 180 / 65535)
print(pot)
ton = (pot + 45) * 100000 / 9
s.duty_ns(int(ton))
utime.sleep_ms(200)