Example #1
0
def actuate(Ser1):

    #Init Motor
    #iniMotor = motorInit(Ser1)

    pause('Y to continue ...', ['Y'])
    iniMotor = Motor(Ser1)
    iniMotor.on()

    # try:
    # pause("ini from actuate>...Y to continue","Y")
    # iniMotor.up(steps = 800, t = .00025,log=True)
    # time.sleep(1)
    # iniMotor.down(steps = 800, t = .00025)
    # except:
    # print 'COULDNT CALIBRATE'
    #steering.calibrateMotor(iniMotor)

    while True:
        #print ['down','up'][int(gPos > 500)], str(gAccel - 500)
        #print "gPos:", str(gPos)
        #print "gAccel: ", str(gAccel)

        try:
            print "Actuate gAccel: ", str(gAccel)
            actuateMotor(gAccel, iniMotor)
            #time.sleep(2)
        except:
            print 'motor-actuate-err'
Example #2
0
def motorInit(Ser):
    """ this sets up motor from class """
    pause('Y to continue ...', ['Y'])
    MyMotor = Motor(Ser)
    return MyMotor
Example #3
0
def Demo():
    Ser1 = MySerial()

    Motor1 = Motor(Ser1)
    Motor1.on()
    Motor1.wind(steps=10)

    time.sleep(3)
    Motor1.off()
    time.sleep(3)

    Motor2 = Motor(Ser1)
    Motor2.on()
    Motor2.wind(steps=400, sleep=.00025)
    time.sleep(3)
    Motor2.off()
    return 1
Example #4
0
def Demo():        
    Ser1 = MySerial()
    
    Motor1 = Motor(Ser1)
    Motor1.on()
    Motor1.wind(steps = 10)

    time.sleep(3)
    Motor1.off()
    time.sleep(3)

    Motor2 = Motor(Ser1)
    Motor2.on()
    Motor2.wind(steps = 400, sleep = .00025)
    time.sleep(3)
    Motor2.off()
    return 1
Example #5
0
def motorInit(Ser):
    """ this sets up motor from class """
    pause('Y to continue ...', ['Y'])
    MyMotor = Motor(Ser)
    MyMotor.on()
    return MyMotor