Revision 1930 trunk/code/projects/calibration_platform/server/cal_sta_server.py

View differences:

cal_sta_server.py
2 2
import sys, serial
3 3

  
4 4
try:
5
	usb = serial.Serial(port='/dev/ttyUSB0', baudrate=19200)
5
#usb = serial.Serial(port='/dev/ttyUSB0', baudrate=19200) # Adruino
6
	usb = serial.Serial(port='/dev/ttyUSB1', baudrate=115200) # Robot
6 7
except serial.SerialException as e:
7 8
	print 'Error: %s' % e
8 9
	sys.exit(0)
9 10

  
10
print usb.inWaiting()
11

  
12 11
while True:
13 12
	if usb.inWaiting() > 0:
14 13
		print usb.read()

Also available in: Unified diff