Last active
January 9, 2016 16:15
-
-
Save ammaaim/39c68471c57bf9323830 to your computer and use it in GitHub Desktop.
Serial port raw reader
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
# $ pip install pyserial | |
import serial | |
ser = serial.Serial('/dev/tty.usbmodem1411') # open serial port | |
while True: | |
x = ser.read() | |
print(int(ord(x))) # print received byte as int value | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment