Hello, i am having the problem with arduino and processing.
I have a arduino mega with Sharp IR sensor sensing data to Processing connected to a Processing program running on a MacMini.
The serial speed is 115200,
but the problem is that when I touch the board, I think the USB cable isn't tight enough and it looses connection, so that the Arduino stops sending data to the computer.
So the only way to fix it would be re-opening the processing app.
Any way to fix this, maybe somehow to reset connection on the go of something.
Thanks
No. Don't do that. That would open a new connection, and reset the Arduino, whenever Processing had finished processing all pending serial data.
You'll need to include some serial-call-and-response (see the Processing example) protocol, where you try, from Processing, to talk to the Arduino. If the Arduino doesn't respond within some period of time, THEN do what you propose.