This sketch assumes that you have some kind of input device (like a button) hooked up to your Arduino on an Analog Input. To get things up and running quickly, hook up two buttons to Analog Inputs 0 and 1 so you can use the attached sketches as is.
Step 1: Upload Arduino Sketch to Your Microcontroller
While the sketch is excessively commented, take note of the argument to the Serial.begin() function: this is the baud rate - in other words, the number of "signaling events per second." This can be modified according to your project specifications, but make sure that the rate is the same in the simultaneous Processing sketch (in my examples, the default is 9600).
If you are not familiar with the second argument of the Serial.print() function, note that this is the base (or format) of the first argument - in this case, DEC stands for "decimal" or a base 10.