示例#1
0
 def __init__(self):
     self.interface = serial_control.SerialInterface()
     self.outputs = {}
     self.signal_refresh = Queue.Queue(1)
     self.thread = threading.Thread(target=self.__RefreshOutputs)
     self.thread.daemon = True
     self.thread.start()
示例#2
0
def main():
    interface = serial_control.SerialInterface()
    while True:
        message = interface.Read(no_checksums=True)
        if message:
            print "Message:"
            float_bytes = message.command
            #float_bytes.reverse()
            print struct.unpack('<f', struct.pack('4B', *float_bytes))[0]
示例#3
0
 def __init__(self, device_basename="ttyACM", baud=115200):
     self.interface = serial_control.SerialInterface(device_basename,
                                                     baud=baud)
     self.outputs = {}
     self.signal_refresh = Queue.Queue(1)
     self.done_ack = Queue.Queue(1)
     self.incoming_messages = Queue.Queue(10)
     self.output_updates = Queue.Queue(100)
     self.thread = threading.Thread(target=self.__RefreshOutputs)
     self.thread.daemon = True
     self.thread.start()
示例#4
0
文件: motor.py 项目: markstev/armnyak
 def __init__(self):
     baud = 9600
     device_basename = "ttyACM"
     self.interface = serial_control.SerialInterface(device_basename,
                                                     baud=baud)
示例#5
0
 def __init__(self, block_mode=False):
     baud = 9600
     device_basename = "ttyACM0"
     self.interface = serial_control.SerialInterface(device_basename,
                                                     baud=baud)
     self.AddMotors()
示例#6
0
 def Reconnect(self):
     self.contiguous_errors = 0
     baud = 9600
     device_basename = "ttyACM0"
     self.interface = serial_control.SerialInterface(device_basename,
                                                     baud=baud)