I'm finding it really hard to phrase this question, mainly because I've found the problem confusing myself.
So I have an IMU stream running from my Arduino and I'm streaming it through pySerial. Basically it gives me an output like this:
** #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11**
which is a continuous stream until I choose to stop it. What I'm trying to do is be able to pick the values individually and compare it a set value that I have already identified
For example: Compare value #2 to a pre-defined integer b. I have not been able to figure out the code for that. Help would be appreciated. So far I have this simple code. It has to be in real-time.
import serial
ser = serial.Serial('COM11', baudrate = 115200, timeout = 1)
def getValues():
arduinoData = ser.readline().decode('ascii')
return arduinoData
while(1):
print(getValues())
This is the output I get from getValues(). It keeps going until I stop it.