I am using processing software to acquire data from 4 arduino microcontrollers simultaneously.
I have seen that after a few minutes data plotting gets delayed and increasing it.
At initially it works fine and the latter stage is happening this. How can I get rid of delay.
I have used a USB hub to connect all the ardunios to the PC.
The delay is still there after removing the print lines to console.
The delay happens after 8000 data points plotted in the plot.
Are there any alternative solutions??
Yes. Point arrays are used as intermediate virtual variables. Furthermore, the data sampling rate is 25 Hz and I have to acquire data for 15 minutes. Minimum of 22500 samples needed to be saved into the file.
So I think this is what you need to try; emptying the arrays and keeping them as small as possible, and as soon as possible. I don’t see any other reason until now.
I can’t look at the code as is and unable to cut and past working code (try and you will see why).
I have been looking into the use of multiple serial ports and was planning to explore this further this weekend.
Please provide code on Arduino side; enough that I get a sense of format sent and any delays so I can simulate.
I have access to many Arduinos.
I suspect that you are trying to acquire and send data (< 60Hz from code comments) to Processing faster than the draw frame rate (50 Hz set by you) and that the serial port reads in the draw loop are “blocking”.
You may want to consider: https://processing.org/reference/libraries/serial/serialEvent_.html
You can do a search and find examples for this in the forums.