Got rid of Global so now only 1 error. Had a look at the 2 links you sent, they seemed very general but will take a detailed look.
Code:
Code:
def init_serial(): print "Found Ports:" for n,s in scan(): print "%s" % s print " " COMNUM = '5' #set you COM port # here #must be declared in each fxn used ser = serial.Serial() ser.baudrate = 4800 ser.port = COMNUM -1#starts at 0, so subtract 1Error:
Error:TypeErrorTraceback (most recent call last)
C:\Users\Dell\Downloads\lat_lon1.py in <module>()
27 ser = serial.Serial()
28 ser.baudrate = 4800
---> 29 ser.port = COMNUM -1#starts at 0, so subtract 1
30
31 ser.timeout = 1 #you must specify a timeout (in seconds) so that the serial port doesn't hang
TypeError: unsupported operand type(s) for -: 'str' and 'int'