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()
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]
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()
def __init__(self): baud = 9600 device_basename = "ttyACM" self.interface = serial_control.SerialInterface(device_basename, baud=baud)
def __init__(self, block_mode=False): baud = 9600 device_basename = "ttyACM0" self.interface = serial_control.SerialInterface(device_basename, baud=baud) self.AddMotors()
def Reconnect(self): self.contiguous_errors = 0 baud = 9600 device_basename = "ttyACM0" self.interface = serial_control.SerialInterface(device_basename, baud=baud)