from machine import Pin, ADC, PWM
from utime import sleep, sleep_ms
servo= PWM(Pin(18), freq = 50)
def map_servo(x):
return int((x - 0) * (125 - 25) / (180 - 0) + 25)
while True:
m = map_servo(0)
servo.duty(m)
print(m)