Jan-24-2021, 07:27 PM
Hey there im not getting the expected result
i expect two numbers temperture and humidty seperated by a comma
here is my error:
line 25, in <module>
dataArray = arduinoString.split(",")
TypeError: a bytes-like object is required, not 'str'
my python code
70 , 50
using python 3.7
i expect two numbers temperture and humidty seperated by a comma
here is my error:
line 25, in <module>
dataArray = arduinoString.split(",")
TypeError: a bytes-like object is required, not 'str'
my python code
import serial import numpy import matplotlib.pyplot as plt #from drawnow import arduinoData = serial.Serial('com3', 9600) while True: while (arduinoData.inWaiting() ==0): pass arduinoString = arduinoData.readline() dataArray = arduinoString.split(",") temp = float(dataArray[0]) humid = float(dataArray[1]) print (temp, ",", humid)what i Expected:
70 , 50
using python 3.7