Skip to content

Instantly share code, notes, and snippets.

@ammaaim
Last active January 9, 2016 16:15
Show Gist options
  • Save ammaaim/39c68471c57bf9323830 to your computer and use it in GitHub Desktop.
Save ammaaim/39c68471c57bf9323830 to your computer and use it in GitHub Desktop.
Serial port raw reader
# $ 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