示例#1
0
import smartServo as servo

if __name__ == '__main__':
    # Open port
    print("Opening Port!")
    if servo.init():
        #take Id for the Servos as Input

        Id = int(input("Enter The Bot ID(Enter -1 to Quit):"))
        print("Enabling Torque on the Servo Id [%d]", Id)
        servo.enable(Id)
        while True:
            exAngle = int(input("Enter the Servo Angle(0-1023)"))
            servo.setSpeed(Id, 200)
            servo.writeRawAngle(Id, exAngle)
            print(
                "------------------------------------------------------------------"
            )
        print("\n[+] Disabling")
示例#2
0
def run(p,q,x,y,r):
            
            servo.writeRawAngle(p,kine(x,y,r)) 
            servo.writeRawAngle(q,kine(x,y,r+1)) 
示例#3
0
        



        while True:
     
            # servo.setSpeed(9,900) 
            # servo.setSpeed(4,900)
            # servo.setSpeed(15,900) 
            # servo.setSpeed(8,900)
            # servo.setSpeed(11,900) 
           # servo.setSpeed(10,900)
            # servo.setSpeed(17,900) 
            # servo.setSpeed(6,900)
            # # A
            servo.writeRawAngle(15,345)  
            servo.writeRawAngle(8,229)
            servo.writeRawAngle(11,638 - 70)  
            servo.writeRawAngle(10,770)
            servo.writeRawAngle(6,345)  
            servo.writeRawAngle(17,229)
            servo.writeRawAngle(9,638)  
            servo.writeRawAngle(4,770)
            # servo.read_load(15,1)

            # servo.writeRawAngle(9,568)
            # servo.writeRawAngle(4,211) 
            # D
#             servo.writeRawAngle(9,337)
#             servo.writeRawAngle(4,198)
#             time.sleep(t)
示例#4
0
def homeposn(l, o, c, p, e, f, g, h):
    sServo.writeRawAngle(k.servoId[0], l)
    sServo.writeRawAngle(k.servoId[1], o)
    sServo.writeRawAngle(k.servoId[2], c)
    sServo.writeRawAngle(k.servoId[3], p)
    sServo.writeRawAngle(k.servoId[4], e)
    sServo.writeRawAngle(k.servoId[5], f)
    sServo.writeRawAngle(k.servoId[6], g)
    sServo.writeRawAngle(k.servoId[7], h)