How to recieve hex data JPEG camera from Arduino and show image in Processing

Hi warayutsitha2,

The first part of your picture is alright, so I’m thinking you have an over-run problem. The source is sending too much too fast, the receiver doesn’t read it all, and some is lost in the middle. You could test this idea by sending smaller pictures. You could try a lower baud rate, this would be a crude way of slowing things down.

If that helps then you could introduce flow control. Try making your Arduino send 200 bytes then pause until it receives a character. Make the processing program read all the bytes that arrive, add them on to a big string, and each 200 bytes received, send a char to the Arduino.

Richard.

2 Likes