def __init__(self): self.c5prev = 0 self.request = serialize_RC_Request() port.write(self.request) parser.set_RC_Handler(self.get) self.autopilot = False self.offtime = 0 self.timestart = time.time()
BAUD = 115200 from msppg import MSP_Parser as Parser, serialize_RC_Request import serial from sys import argv if len(argv) < 2: print('Usage: python3 %s PORT' % argv[0]) print('Example: python3 %s /dev/ttyUSB0' % argv[0]) exit(1) parser = Parser() request = serialize_RC_Request() port = serial.Serial(argv[1], BAUD) def handler(c1, c2, c3, c4, c5, c6, c7, c8): print(c1, c2, c3, c4, c5) port.write(request) parser.set_RC_Handler(handler) port.write(request) while True: try: