You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
358 B

5 years ago
#!/usr/bin/python
import serial, string
output = " "
ser = serial.Serial('/dev/ttyUSB1', 9600, 8, 'N', 1, timeout=1)
5 years ago
while True:
while output != "":
output = ser.read(4)
5 years ago
print len(output)
try:
print int(output)
except ValueError:
print ":".join("{:02x}".format(ord(c)) for c in output)
print output
output = " "