2016-09-20 12:57:28 +02:00
|
|
|
import serial, sys
|
|
|
|
port = "/dev/ttyUSB0"
|
2016-09-20 18:51:20 +02:00
|
|
|
baudrate = 115200
|
2016-09-20 12:57:28 +02:00
|
|
|
ser = serial.Serial(port,baudrate,timeout=0.001)
|
|
|
|
while True:
|
|
|
|
ser.write(bytearray([0x3c, 0x3e, 0x10, 0x0d, 0x0a]))
|
|
|
|
|
|
|
|
if ser.inWaiting() > 0:
|
|
|
|
data = list(ser.read(64))
|
|
|
|
print data
|
|
|
|
|
|
|
|
sys.stdout.flush()
|