📅  最后修改于: 2022-03-11 14:56:14.487000             🧑  作者: Mango
from gpiozero import AngularServo
from time import sleep
servo = AngularServo(18, min_pulse_width=0.0006, max_pulse_width=0.0023)
while (True):
servo.angle = 90
sleep(2)
servo.angle = 0
sleep(2)
servo.angle = -90
sleep(2)