diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2003-01-13 22:36:50 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2003-01-13 22:36:50 +0000 |
commit | 3af8da87216ece9d2f1881b955f88873e58bacb0 (patch) | |
tree | 07d890bfb856660b81d4c193d4131c7ef0fc0181 | |
parent | 95beabc780dfc4edf3f860a861a36b7c8e601d82 (diff) | |
download | pyserial-git-3af8da87216ece9d2f1881b955f88873e58bacb0.tar.gz |
note about usb adapters
-rw-r--r-- | pyserial/README.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pyserial/README.txt b/pyserial/README.txt index 5236941..fa30601 100644 --- a/pyserial/README.txt +++ b/pyserial/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 |