diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-07-21 13:32:45 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-07-21 13:32:45 +0000 |
commit | 86e8787c23663ce357c8311e070442be3d1297f2 (patch) | |
tree | 474a4969a25335245d113094d94989c2dbde797c /documentation/shortintro.rst | |
parent | 2297814a5de3ca85869bd19009966db9f12a8840 (diff) | |
download | pyserial-git-86e8787c23663ce357c8311e070442be3d1297f2.tar.gz |
documentation updates
Diffstat (limited to 'documentation/shortintro.rst')
-rw-r--r-- | documentation/shortintro.rst | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/documentation/shortintro.rst b/documentation/shortintro.rst index 5e117ca..048f94d 100644 --- a/documentation/shortintro.rst +++ b/documentation/shortintro.rst @@ -2,6 +2,9 @@ Short introduction ==================== +Opening serial ports +==================== + Open port 0 at "9600,8,N,1", no timeout:: >>> import serial @@ -25,6 +28,9 @@ Open second port at "38400,8,E,1", non blocking HW handshaking:: >>> s = ser.read(100) # read up to one hundred bytes ... # or as much is in the buffer +Configuring ports later +======================= + Get a Serial instance and configure/open it later:: >>> ser = serial.Serial() @@ -39,9 +45,13 @@ Get a Serial instance and configure/open it later:: >>> ser.isOpen() False +Readline +======== Be carefully when using "readline". Do specify a timeout when opening the serial port otherwise it could block forever if no newline character is received. Also note that "readlines" only works with a timeout. "readlines" depends on having a timeout and interprets that as EOF (end of file). It raises -an exception if the port is not opened correctly. Do also have a look at the -example files in the examples directory in the source distribution or online. +an exception if the port is not opened correctly. + +Do also have a look at the example files in the examples directory in the +source distribution or online. |