So I’m getting quite mad not being able to accomplish something so easy.
I’ve an Arduino sending various values through the serial port. The values appearing are for example 152,0,140,92,53…etc.
I’d like to just save for example 100 of those values and then stop recording.
I can’t actually get a functioning sequence without the port “shutting” itself or the data not being recorded at all.
I’ve looked through TONS of tutorials but I never get it to work.
Can someone please guide me through a working version of it?
The data grabbing sequence is what follows
void serialEvent(Serial mySerial)
{
String inString = mySerial.readStringUntil('\n');
if (inString!=null); // this area splits the arduino inputs such that they can be received seperately
{
inString=trim(inString);
float[] sensors= float (split(inString, ","));
if (sensors.length>=2)
{
gauge0[k]=sensors[0];
gauge1[k]=sensors[1];
k++;
}
}
}