1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 19:54:57 +08:00
serial/tests/proof_of_concepts/python_serial_test.py

16 lines
273 B
Python
Raw Normal View History

2012-01-23 14:23:01 -06:00
#!/usr/bin/env python
import serial, sys
if len(sys.argv) != 2:
print "python: Usage_serial_test <port name like: /dev/ttyUSB0>"
sys.exit(1)
sio = serial.Serial(sys.argv[1], 115200)
sio.timeout = 250
while True:
sio.write("Testing.")
print sio.read(8)