/ examples / servokit_all_servos_sequential.py
servokit_all_servos_sequential.py
 1  """Example that iterates through a servo on every channel, sets each to 180 and then back to 0."""
 2  import time
 3  from adafruit_servokit import ServoKit
 4  
 5  # Set channels to the number of servo channels on your kit.
 6  # 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
 7  kit = ServoKit(channels=8)
 8  
 9  for i in range(len(kit.servo)):
10      kit.servo[i].angle = 180
11      time.sleep(1)
12      kit.servo[i].angle = 0
13      time.sleep(1)