New to processing---------motion tracking

This is a sorta old topic.

But anyway, yeah, that code should work, as long as x and y don't get mixed up.
Which they probably will, so it would be good to somehow sync the two, maybe have the arduino send a message when it is ready, and the computer responds with the coordinates.