So I've posted some days ago about a similar problem, today I was trying to get a simpler arduino->processing into working first, but neither this one works. :(
Basically 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 Arduino part is simple as that:
The data grabbing sequence in Processing is what follows
float gauge0 = new float;
float gauge1 = new float;
size (800, 580);
String myPort = Serial.list();
mySerial = new Serial(this, myPort, 9600);
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
float sensors= float (split(inString, ","));
I also tried to use the Serial.available function as I read from Robin2 guide, but it didn't help much.
Man this is getting exhausting...
The code you posted does something. Re-read your post, and see if you can figure out what your code actually does. Or what the problem that you need help with is.
Your Arduino will send data forever. The processing app will keep writing to the two arrays, even when they are full. That hardly seems like a good idea.
Processing sketches need to have a draw() method.