Hi! I purchased a Zio 16 Servo Controller for Qwiic from SparkFun, but it’s not entirely clear how to get this to work with CircuitPython over Qwiic. The board’s docs mention it’s based on the Adafruit PWM Servo Library and operates like their Feather Bonnets, but with Qwiic.
I’ve added a Qwiic Cable to an Arduino Nano RP2040 Connect & other Qwiic / STEMMA QT products work great. But I’m not sure how to get things working with a Zio. I’ve connected a Tower SG92R to Channel 0 on the Zio & have tried running sample CircuitPython servo code:
“”“CircuitPython Essentials Servo standard servo example”“”
import time
import board
import pwmio
from adafruit_motor import servo
create a PWMOut object on Pin A2.
pwm = pwmio.PWMOut(board.A2, duty_cycle=2 ** 15, frequency=50)
Create a servo object, my_servo.
my_servo = servo.Servo(pwm)
while True:
for angle in range(0, 180, 5): # 0 - 180 degrees, 5 degrees at a time.
my_servo.angle = angle
time.sleep(0.05)
for angle in range(180, 0, -5): # 180 - 0 degrees, 5 degrees at a time.
my_servo.angle = angle
time.sleep(0.05)
Since the Nano RP2040 has I2C on pins A4 and A5, I tried subbing out A4 first, then A5 in the code above. Code runs, but nothing happens. Any ideas on how to get this to work with CircuitPython? Thanks!