hi everyone, i just work on my ecg project. buat i'm stuck in plotting the real time data from udoo. Can anyone help me find some code for plot the real time code in python? i just try some this code but it didnt work well import serial import time import matplotlib.pyplot as plt import numpy as np ubaudrate = 9600 uport = '/dev/ttyMCC' # set the correct port before run it userial = serial.Serial(uport, ubaudrate, timeout=1) userial.timeout = 10 if userial.isOpen(): while True: size = userial.inWaiting() if size: data = np.float64(np.frombuffer(data.encode(), 'B')) plt.figure plt.plot(data, 'b', alpha=0.75) plt.legend(('Sinyal Jantung'), loc='best') plt.grid(True) plt.show() #print data else: print ('no data') time.sleep(1) else: print ('serial not open') # z1serial.close() # close z1serial if z1serial is open. thanks for your help
See for an example in this tread https://www.udoo.org/forum/threads/how-to-control-neo-arduino-from-web-page.6242/ In the second post there is a web application with a running chart showing "real time" data. The source code is in an attached zip in the first topic.