Open ArunKRanadeep opened 8 months ago
import time import busio
from adafruit_servokit import ServoKit kit = ServoKit(channels=16,i2c=(busio.I2C(board.SCL, board.SDA)))
kit.servo[0].set_pulse_width_range(775, 2450) kit.servo[1].set_pulse_width_range(775, 2450)
kit.servo[0].angle = 0 kit.servo[1].angle = 180 time.sleep(1)
while True: for tgtAngle in range(0, 180, 1): kit.servo[0].angle = tgtAngle kit.servo[1].angle = 180 - tgtAngle time.sleep(0.1) for tgtAngle in range(180, 0, -1): kit.servo[0].angle = tgtAngle kit.servo[1].angle = 180 - tgtAngle time.sleep(0.1)
can you help me ,
You'll need to install Blinka: https://learn.adafruit.com/circuitpython-libraries-on-micropython-using-the-raspberry-pi-pico/overview
import time import busio
from adafruit_servokit import ServoKit kit = ServoKit(channels=16,i2c=(busio.I2C(board.SCL, board.SDA)))
Tuned for GWS S03T STD Servos
kit.servo[0].set_pulse_width_range(775, 2450) kit.servo[1].set_pulse_width_range(775, 2450)
Return servos to starting positions
kit.servo[0].angle = 0 kit.servo[1].angle = 180 time.sleep(1)
while True: for tgtAngle in range(0, 180, 1): kit.servo[0].angle = tgtAngle kit.servo[1].angle = 180 - tgtAngle time.sleep(0.1) for tgtAngle in range(180, 0, -1): kit.servo[0].angle = tgtAngle kit.servo[1].angle = 180 - tgtAngle time.sleep(0.1)
can you help me ,