I am new to Pyserial, I'm trying to use it for communication between my computer and a microcontroller, I need to receive the data and put it into variables so that I can plot with those variables. Is there any way to do this? I have currently figured out reading data from input signals.
import serial
import sys
import Queue
import threading
ser = serial.Serial(port='COM6',timeout=None, baudrate= 57600)
# opening the port 'ser' that was just created to receive data
flag = ser.isOpen()
print flag
while 1:
data = ser.read(1)
n = ser.inWaiting()
if n:
data = data + ser.read(n)
data = data.split()
for item in data:
item = str(item)
sys.stdout.write(item + '\n')