Slow data transmission between two Arduinos


There is a timeout in the Serial.parseInt() function. Because the serial cannot be sure whether it received all digits of the integer or not. You can reduce the timeout with the Serial.setTimeout() function.

"Parsing stops when no characters have been read for a configurable time-out value, or a non-digit is read"

So you might be able to send a "stop" character a letter for instance.

You can find the description in the Arduino reference.

You can use this serial transfer library to very quickly and reliably transfer up to 255 bytes of data per packet - plenty enough to send an int_16 or int_32.

I use the library myself for sending commands to my Arduino RC plane and to send telemetry data back to the hand controller with a refresh rate of about 50Hz (rate not limited by the serial transfer, its due to my on-board LiDAR sensor).

Give the library a shot