Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (22 sloc) 563 Bytes
# Continuous Servo Test Program for CircuitPython
import time
import board
import pulseio
from adafruit_motor import servo
# create a PWMOut object on Pin A2.
pwm = pulseio.PWMOut(board.A2, frequency=50)
# Create a servo object, my_servo.
my_servo = servo.ContinuousServo(pwm)
while True:
print("forward")
my_servo.throttle = 1.0
time.sleep(2.0)
print("stop")
my_servo.throttle = 0.0
time.sleep(2.0)
print("reverse")
my_servo.throttle = -1.0
time.sleep(2.0)
print("stop")
my_servo.throttle = 0.0
time.sleep(4.0)
You can’t perform that action at this time.