Simple test
Ensure your device works with this simple test.
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4"""Simple test for using adafruit_motorkit with a DC motor"""
5import time
6import board
7from adafruit_motorkit import MotorKit
8
9kit = MotorKit(i2c=board.I2C())
10
11kit.motor1.throttle = 1.0
12time.sleep(0.5)
13kit.motor1.throttle = 0
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4"""Simple test for using adafruit_motorkit with a stepper motor"""
5import time
6import board
7from adafruit_motorkit import MotorKit
8
9kit = MotorKit(i2c=board.I2C())
10
11for i in range(100):
12 kit.stepper1.onestep()
13 time.sleep(0.01)