We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a40308 commit 2ddd080Copy full SHA for 2ddd080
1 file changed
CircuitPython_Essentials/CircuitPython_Continuous_Servo.py
@@ -0,0 +1,25 @@
1
+# Continuous Servo Test Program for CircuitPython
2
+import time
3
+import board
4
+import pulseio
5
+from adafruit_motor import servo
6
+
7
+# create a PWMOut object on Pin A2.
8
+pwm = pulseio.PWMOut(board.A2, frequency=50)
9
10
+# Create a servo object, my_servo.
11
+my_servo = servo.ContinuousServo(pwm)
12
13
+while True:
14
+ print("forward")
15
+ my_servo.throttle = 1.0
16
+ time.sleep(2.0)
17
+ print("stop")
18
+ my_servo.throttle = 0.0
19
20
+ print("reverse")
21
+ my_servo.throttle = -1.0
22
23
24
25
+ time.sleep(4.0)
0 commit comments