import serial
ser = serial.Serial(
print ser.portstr
ser.setWriteTimeout(1)
ser.write("hello" + "\n")
ser.read(9999)
the above sample code best describes how to write or read from a serial port using python - pyserial library. This is not the best of the solutions available out there but def simple (probably the simplest :) ). you could do more digging into the serial library too if you would like.
Like I always say happy scripting !!!
No comments:
Post a Comment