Created
November 13, 2018 08:46
-
-
Save dubkov/d50548d4cc16f268a8296b813f374cf2 to your computer and use it in GitHub Desktop.
pyser.py
This file contains 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
import serial | |
from time import sleep | |
ser = serial.Serial('/dev/ttyUSB0') | |
ser.baudrate = 115200 | |
while (1): | |
line = ser.readline() | |
line = line.decode("utf-8") | |
first_param, second_param = line.split(",") | |
print(int(first_param), int(second_param)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment