Created
July 1, 2020 20:29
-
-
Save stefanache/979f7fe28de7a5092bfeb1782b7de41d to your computer and use it in GitHub Desktop.
python receiver
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
#!C:\Python27\python | |
import serial | |
import time | |
port='COM4' | |
baud=9600 | |
ser=serial.Serial(port, baud, timeout=0, parity=serial.PARITY_EVEN, rtscts=1) | |
while True: | |
data = ser.readline(ser.in_waiting).decode() | |
print(data) | |
time.sleep(1.0) # sleep 1s | |
ser.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see at https://gist.github.com/stefanache/963311e8aee34f4858c25674657f51d1