mattercontrol/ComTester.py
Lars Brubaker 7a9de67a98 no message
2014-12-31 10:01:13 -08:00

10 lines
No EOL
269 B
Python

import serial
ser = serial.Serial('COM14', 250000, timeout=1)
x = ser.read() # read one byte
s = ser.read(10) # read up to ten bytes (timeout)
while True:
line = ser.readline() # read a '\n' terminated line
print line
ser.write('ok\n')
ser.close()