Advertisement
ohmohm

Python reading serial port

Feb 24th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. import serial
  2.  
  3. ser = serial.Serial('/dev/ttyACM0', 9600, timeout=0)
  4. while True:
  5.     line = ser.readline()
  6.     if (line):
  7.         print (line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement