Debian Codegraph @

microhope/microhope-doc/prog/rs232echo.py

raw
1 import serial
2 fd = serial.Serial('/dev/ttyS0', 38400, stopbits=1, \
3 timeout = 1.0, parity=serial.PARITY_EVEN)
4
5 while 1:
6 c = raw_input('Enter a character : ')
7 fd.write(c)
8 print ('Receiced ', fd.read())
9