I’m trying to get the data from the serial port to which my Arduino is connected.
I’m always getting this error message:
AttributeError: ‘module’ object has no attribute ‘Serial’
I was first using Python 3.7 and did not work, so i went to Python 2.7 and did not work either.
I’m currently using Anaconda (Spyder) for python 3.7 and Canopy for Python 2.7.
Here’s my code:
ser = serial.Serial(‘COM20’)
ser_bytes = ser.readline()
decoded_bytes = float(ser_bytes[0:len(ser_bytes)-2].decode(“utf-8”))