We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98cec09 commit e015dc2Copy full SHA for e015dc2
docs/source/api/servo-board.rst
@@ -60,3 +60,26 @@ widths which in some cases will force the servo to try and turn past its
60
internal end-stops. You should experiment and find what the actual limit
61
of your servos are (it almost certainly won't be -1 and 1) and not
62
drive them past that.
63
+
64
+Example
65
+-------
66
67
+.. code:: python
68
69
+ from sbot import *
70
+ import time
71
72
+ r = Robot()
73
+ servos = r.servo_board.servos
74
75
+ # Move all servos to the middle position
76
+ for servo in servos:
77
+ servo.position = 0
78
79
80
+ # Slowly sweep servo 0 to the end and disengage it
81
+ for percentage in range(100):
82
+ position = percentage / 100
83
+ servos[0].position = position
84
+ time.sleep(0.05)
85
+ servos[0].position = None
0 commit comments