Created
January 6, 2020 18:25
-
-
Save jkirklan/bbd277016da3973a744652604815dde1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import serial | |
ser = serial.Serial( | |
port='COM5',\ | |
baudrate=9600,\ | |
parity=serial.PARITY_NONE,\ | |
stopbits=serial.STOPBITS_ONE,\ | |
bytesize=serial.EIGHTBITS,\ | |
timeout=0) | |
print("connected to: " + ser.portstr) | |
count=1 | |
while True: | |
for line in ser.read(): | |
print(str(count) + str(': ') + chr(line) ) | |
count = count+1 | |
ser.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment