Vikram Gardella
Lead Full-Stack Engineer
GitHub
Algorithm DesignArtificial IntelligenceRoboticsBlockchain Prototype3D-Printing & CADWeb DevelopmentiOS & MacOS
from __future__ import division
import RPi.GPIO as gpio
import time
import curses
from adafruit_servokit import ServoKit
kit = ServoKit(channels = 16)
screen = curses.initscr()
curses.noecho()
curses.cbreak()
screen.keypad(True)
screen.nodelay(True)
for i in range(16):
kit.servo[i].angle = 90
#kit.servo[x].set_pulse_width_range(min, max)
#middle and bottom apparent optimal range:
#[700, 1800] = 180 degree range approx.
#[800, 1400] so 1100 is mid angle
limb_names = ['front_left', 'front_right', 'back_left', 'back_right']
limb_motor_channels = [[0, 1, 2], [15, 14, 13], [3, 4, 5], [12, 11, 10]]
limb_index = 0
top_motor_angs = [90, 90, 90, 90]
mid_motor_angs = [90, 90, 90, 90]
bot_motor_angs = [90, 90, 90, 90]
for i in range(16):
kit.servo[i].angle = 90
try:
while True:
char = screen.getch()