from machine import Pin, PWM
import time
servo1=PWM(Pin(15))
servo1.freq(50)
boton0=Pin(17,Pin.IN,Pin.PULL_DOWN)
boton15=Pin(18,Pin.IN,Pin.PULL_DOWN)
boton40=Pin(16,Pin.IN,Pin.PULL_DOWN)
while 1:
if boton0.value()==1:
servo1.duty_u16(1638)
time.sleep(0.5)
if boton15.value()==1:
servo1.duty_u16(4915)
time.sleep(0.5)
if boton40.value()==1:
servo1.duty_u16(8150)
time.sleep(0.5)