Simple test
Ensure your device works with this simple test.
examples/servokit_simpletest.py
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4"""Simple test for a standard servo on channel 0 and a continuous rotation servo on channel 1."""
5
6import time
7
8from adafruit_servokit import ServoKit
9
10# Set channels to the number of servo channels on your kit.
11# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
12kit = ServoKit(channels=8)
13
14kit.servo[0].angle = 180
15kit.continuous_servo[1].throttle = 1
16time.sleep(1)
17kit.continuous_servo[1].throttle = -1
18time.sleep(1)
19kit.servo[0].angle = 0
20kit.continuous_servo[1].throttle = 0