root / trunk / code / projects / calibration_platform / server / cal_sta_server.py @ 1930
History | View | Annotate | Download (320 Bytes)
1 | 1926 | jsexton | #!/usr/bin/python
|
---|---|---|---|
2 | import sys, serial |
||
3 | |||
4 | try:
|
||
5 | 1930 | jsexton | #usb = serial.Serial(port='/dev/ttyUSB0', baudrate=19200) # Adruino
|
6 | usb = serial.Serial(port='/dev/ttyUSB1', baudrate=115200) # Robot |
||
7 | 1926 | jsexton | except serial.SerialException as e: |
8 | print 'Error: %s' % e |
||
9 | sys.exit(0)
|
||
10 | |||
11 | while True: |
||
12 | if usb.inWaiting() > 0: |
||
13 | print usb.read()
|
||
14 | |||
15 | usb.close() |