Aug-28-2019, 10:45 AM
import serial import matplotlib.pyplot as plt from drawnow import * values = [] plt.ion() cnt=0 serialArduino = serial.Serial('COM3', 115200) def plotValues(): plt.title('Serial value from Arduino') plt.grid(True) plt.ylabel('Values') plt.plot(values, 'rx-', label='values') plt.legend(loc='upper right') #pre-load dummy data while True: while (serialArduino.inWaiting()==0): pass valueRead = serialArduino.readline() print(valueRead)I'm getting the temperatures like this:
---------------------------------------
b'27.39 , 27.22\r\n'
b'27.35 , 27.27\r\n'
b'27.44 , 27.33\r\n'
b'27.41 , 27.37\r\n'
b'27.39 , 27.33\r\n'
-------------------------------------------------
How I can fix this error and get clean result, and also how I can graph in real time and storage the data?
Thank you so much for the help.