from machine import Pin,ADC,PWM
from time import sleep
#attach each servo to a PWM-capable pin
servo1=PWM(Pin(0))
servo2=PWM(Pin(1))
#set the pulse frequency for each servo
servo1.freq(50)
servo2.freq(50)
#test each servo by looping through a range of pulse widths
# 3000/65536 corresponds roughly to a 1ms pulse
# 7000/65536 corresponds roughly to a 2ms pulse
for pulseWidth in range(3000,7000):
servo1.duty_u16(pulseWidth)
sleep(0.001)
for pulseWidth in range(3000,7000):
servo2.duty_u16(pulseWidth)
sleep(0.001)