Skip to content

Instantly share code, notes, and snippets.

@jrziviani
Created October 12, 2012 03:52
Show Gist options
  • Save jrziviani/3877208 to your computer and use it in GitHub Desktop.
Save jrziviani/3877208 to your computer and use it in GitHub Desktop.
Arduino - read serial debug
import serial
import time
sr = serial.Serial('/dev/ttyACM0', 9600)
data = ''
while(True):
data += sr.read(1)
if (data[-1:] == '\n'):
print data
print '-------'
data = ''
sr.flushOutput()
time.sleep(0.5)
sr.close()
--------------------
sr.write('data')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment