Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding multi-servo examples #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/servokit_all_servos_sequential.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Example that iterates through a servo on every channel, sets each to 180 and then back to 0."""
import time
from adafruit_servokit import ServoKit

# Set channels to the number of servo channels on your kit.
# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
kit = ServoKit(channels=8)

for i in range(len(kit.servo)):
kit.servo[i].angle = 180
time.sleep(1)
kit.servo[i].angle = 0
time.sleep(1)
14 changes: 14 additions & 0 deletions examples/servokit_all_servos_synchronised.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Example that rotates servos on every channel to 180 and then back to 0."""
import time
from adafruit_servokit import ServoKit

# Set channels to the number of servo channels on your kit.
# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
kit = ServoKit(channels=8)

for i in range(len(kit.servo)):
kit.servo[i].angle = 180
time.sleep(1)
for i in range(len(kit.servo)):
kit.servo[i].angle = 0
time.sleep(1)