def full_calibrate(self):
     timestamp = time.strftime('%m-%d_%H%M')
     fileName = "data\\dmc_calib_" + timestamp
     self.calibrate_both_spins(fileName)
     self.calibrate_all_straight(fileName)
     for i in range(2):
         serial.write("cmd write_motor_settings")
     print("!!!\nDone calibrating!\n!!!")
예제 #2
0
 def full_calibrate(self):
     timestamp = time.strftime('%m-%d_%H%M')
     fileName = "data\\dmc_calib_" + timestamp
     self.calibrate_both_spins(fileName)
     self.calibrate_all_straight(fileName)
     for i in range(2):
         serial.write("cmd write_motor_settings")
     print("!!!\nDone calibrating!\n!!!")
예제 #3
0
 def full_calibrate(self):
     #first, calibrate droplet spin for one direction. This will give us motor sign and relative values for the three motors.
     #then calibrate directions 0, 2, and 4 (or 1, 3, and 5)
     timestamp = time.strftime('%m-%d_%H%M')
     fileName = "data\\dmc_calib_" + timestamp
     self.calibrate_both_spins(fileName)
     self.calibrate_all_straight(fileName)
     for i in range(2):
         serial.write("cmd write_motor_settings")
     print("!!!\nDone calibrating!\n!!!")
예제 #4
0
 def full_calibrate(self):
     #first, calibrate droplet spin for one direction. This will give us motor sign and relative values for the three motors.
     #then calibrate directions 0, 2, and 4 (or 1, 3, and 5)
     timestamp = time.strftime('%m-%d_%H%M')
     fileName = "data\\dmc_calib_" + timestamp
     self.calibrate_both_spins(fileName)
     self.calibrate_all_straight(fileName)
     for i in range(2):
         serial.write("cmd write_motor_settings")
     print("!!!\nDone calibrating!\n!!!")
예제 #5
0
def process_and_transmit_line(line):
    byte_strs = [str(line[i])+str(line[i+1]) for i in range(1,len(line)-1,2)]
    byte_sum=0
    for b in byte_strs:
        byte_sum+=int(b,16)
    byte_sum-=int(byte_strs[-1],16)
    if(format(0xFF&((0xFF^(byte_sum & 0xFF))+1),'02X') != byte_strs[-1]):
        print("checksum mismatch?")
        print("\t" + format(0xFF&((0xFF^(byte_sum & 0xFF))+1),'02X'))
        print("\t" + byte_strs[-1])
    dat = ''.join([chr(int(b,16)) for b in byte_strs])
    #print(dat)
    Serial.write(dat)
예제 #6
0
def stop_walk():
    serial.write("cmd stop_walk")
예제 #7
0
def move_steps(direction, num_steps):
    serial.write("cmd move_steps %d %d"%(direction, num_steps))
예제 #8
0
def set_motors(direction, mot0val, mot1val, mot2val):
    serial.write("cmd set_motors %d %d %d %d"%(direction, mot0val, mot1val, mot2val))
    #Once more, just to be sure.
    serial.write("cmd set_motors %d %d %d %d"%(direction, mot0val, mot1val, mot2val))
예제 #9
0
def set_led(r, g, b):
    serial.write("cmd set_led rgb %d %d %d"%(r, g, b))
예제 #10
0
def stop_walk():
    serial.write("cmd stop_walk")
예제 #11
0
def move_steps(direction, num_steps):
    serial.write("cmd move_steps %d %d" % (direction, num_steps))
예제 #12
0
def set_motors(direction, mot0val, mot1val, mot2val):
    serial.write("cmd set_motors %d %d %d %d" %
                 (direction, mot0val, mot1val, mot2val))
    #Once more, just to be sure.
    serial.write("cmd set_motors %d %d %d %d" %
                 (direction, mot0val, mot1val, mot2val))
예제 #13
0
def set_led(r, g, b):
    serial.write("cmd set_led rgb %d %d %d" % (r, g, b))