Skip to content

Instantly share code, notes, and snippets.

@stefanache
Created July 1, 2020 20:29
Show Gist options
  • Save stefanache/979f7fe28de7a5092bfeb1782b7de41d to your computer and use it in GitHub Desktop.
Save stefanache/979f7fe28de7a5092bfeb1782b7de41d to your computer and use it in GitHub Desktop.
python receiver
#!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()
@stefanache
Copy link
Author

@stefanache
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment