Skip to content

Instantly share code, notes, and snippets.

@nickjackson
Created April 8, 2013 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickjackson/5340543 to your computer and use it in GitHub Desktop.
Save nickjackson/5340543 to your computer and use it in GitHub Desktop.
pi and arduino
from sys import exit
import serial
serialFromArduino = serial.Serial("/dev/tty.usbmodem411",9600)
serialFromArduino.flush()
while 1:
try:
print(serialFromArduino.readline().rstrip())
except KeyboardInterrupt:
serialFromArduino.close()
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment