I'm trying to send two values, mouseX and mouseY, to my Arduino Diecimilla over serial. It works fine with just one value, but I'm really not sure how to send two values and then seperate them out of the incoming serial data on the Arduino. I haven't been able to find anything on Google, mostly because I don't know what I'm searching for. Is this called flow control? The best solution I can come up with is formatting the serial data, say for example by inserting an x in front of the x value and a y in front of the y value, and then checking each incoming byte in my Arduino code, looking for an x character or a y character. The specifics of all that kind of scare me though and I have no idea where to start...
Or another thought was to have Processing send one byte of data corresponding to mouseX, then wait for a confirmation from Arduino that the byte has been recieved, then Processing would send the next byte, mouseY, and so on.
I just keep thinking that there has to be a more elegant and well established method for dealing with this problem. All of the Processing / Arduino tutorials and references I've found refer to sending single values only. Might someone be able to please point me in the right direction? Even if you could just throw some search terms at me that would be great - my brain is exploding.