Python 3.5.1

Joel Cotto joelcotto23 at gmail.com
Fri Jan 29 10:35:57 EST 2016


Hi,

I'm using the new release of python ver 3.5.1 but i got problem using its
code to communicate w/ serial port. I'm receiving port error. Hope you can
guide me if there are change made in the command. Thanks and Good Day

import serial ser = 0 def init_serial(): COMNUM = 1 global ser ser =
serial.Serial() ser.baudrate = 9600 ser.port = COMNUM - 1 ser.timeout = 10
ser.isOpen() if ser.isOpen(): print ('Open: ' + ser.portstr) init_serial()
temp = input('Enter SCL command, hit enter:\r\n') ser.write(temp) while 1:
bytes = ser.readline() print ('You sent: ' + bytes)



More information about the Python-list mailing list