Skip to content
Snippets Groups Projects
Commit 7c6c25b5 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

A demo program for the pySerial support.

parent cb2c928d
No related branches found
No related tags found
No related merge requests found
# This example opens the first serial port in 4800 bits per second and
# reads input from it. It terminates after 10 consecutive seconds
# with no input.
import pcl_expect.pyserial
import pcl_expect
port = pcl_expect.pyserial.Serial(0, baudrate=4800)
x = pcl_expect.Controller()
while x.loop():
if x.re(port, "..*"):
print "Got", repr(port.consumed)
elif x.timeout():
print "Timeout"
break
port.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment