python serial 통신

* http://stackoverflow.com/questions/4040151/python-serial-port

* http://pinkwink.kr/566

pyserial 설치

easy_install pyserial
혹은
pip install pyserial

serial 통신

import serial
ser = serial.Serial('com13', 9600, timeout = 5)
# ser = = serial.Serial(13,9600)
ser.read(100)

d2 = ('\x02' , '\x30', '\x31', '\x35', '\x31', '\x36', '\x36' , '\x32', '\x36' , '\x03', '\x00')
ser.write(''.join(d2))

ser.close()


이 블로그의 인기 게시물