from pyb import Servo
import time
s1 = Servo(1) # servo on position 1 (P7)
s2 = Servo(2)
while(1):
s1.angle(90) # move to 90 degrees
s2.angle(90) # move to 90 degrees
time.sleep(1)
s1.angle(45) # move to 45 degrees
s2.angle(45) # move to 45 degrees
time.sleep(1)
s1.angle(0) # move to 0 degrees
s2.angle(0) # move to 0 degrees
time.sleep(1)
s1.angle(-60) # move to -60 degrees
s2.angle(-60) # move to -60 degrees
time.sleep(1)
s1.angle(-90) # move to -90 degrees
s2.angle(-90) # move to -90 degrees
time.sleep(1)
print(1111)
重写了代码,舵机运动很随意,时好时坏的,一会转了,一会又不转了