Created
October 12, 2012 03:52
-
-
Save jrziviani/3877208 to your computer and use it in GitHub Desktop.
Arduino - read serial debug
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 | |
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