summaryrefslogtreecommitdiff
path: root/README.txt
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2003-01-13 22:36:50 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2003-01-13 22:36:50 +0000
commit871ec78048bb542748c9c1250b52c77672efba7e (patch)
treed3359e60f50a0b9b7f439a618993e545ecbbc3c4 /README.txt
parenta34c3338693b9bc51c3f11249903cc93284e2cd1 (diff)
downloadpyserial-871ec78048bb542748c9c1250b52c77672efba7e.tar.gz
note about usb adapters
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@68 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'README.txt')
-rw-r--r--README.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/README.txt b/README.txt
index 5236941..fa30601 100644
--- a/README.txt
+++ b/README.txt
@@ -46,24 +46,31 @@ let Disutils do the rest: "python setup.py install"
The files get installed in the "Lib/site-packages" directory in newer
Python versions.
+Serial to USB adapters
+Such adapters are reported to work under Mac OSX and Windows. They are
+mapped to a normal COM port under Windows, but on Mac OSX they have
+special device names like "/dev/cu.USA19QW11P1.1" either use these
+names for the serial ports or create a link to the common device names
+like "ln -s /dev/cu.USA19QW11P1.1 /dev/cuaa0"
+
Short introduction
------------------
-Open port 0 at 9600,8,N,1, no timeout
+Open port 0 at "9600,8,N,1", no timeout
>>> import serial
>>> ser = serial.Serial(0) #open first serial port
>>> print ser.portstr #check which port was realy used
>>> ser.write("hello") #write a string
>>> ser.close() #close port
-Open named port at 19200,8,N,1, 1s timeout
+Open named port at "19200,8,N,1", 1s timeout
>>> ser = serial.Serial('/dev/ttyS1', 19200, timeout=1)
>>> x = ser.read() #read one byte
>>> s = ser.read(10) #read up to ten bytes (timeout)
>>> line = ser.readline() #read a \n terminated line
>>> ser.close()
-Open second port at 38400,8,E,1, non blocking HW handshaking
+Open second port at "38400,8,E,1", non blocking HW handshaking
>>> ser = serial.Serial(1, 38400, timeout=0,
... parity=serial.PARITY_EVEN, rtscts=1)
>>> s = ser.read(100) #read up to one hunded bytes