I have been trying to dissect the differences between the implementation of serial asynchronous communication in Processing 1.0 and the Arduino IDE. There are even broader differences between the two environments (Arduino is based on C/C++, and Processing is Java based) but fortunately these do not come into play with the current investigation. Arduino is a simple development environment which allows for the programming of Arduino boards. The board I am currently using is the Duemilanove (Italian for 2009), which has at its heart an ATmega.328 micro-controller.

Processing is a programming language that allows users to quickly create programs, or “sketches”, that generate graphics and gives control to input and output devices such as the keyboard, mouse, and serial ports. More information on Processing can be found here. What follows is how to enable serial communication for both the Arduino IDE and Processing.
The first issue is choosing which serial port to use in the current project. In the Arduino IDE, this is accomplished by selecting Tools — Serial Port and then choosing the appropriate serial port.

Note that in the above figure, that Serial Port is not available (grey). If you have successfully installed the serial drivers, then you should get a list of available ports (I’m not writing this entry from my development machine). Selecting your serial port in the Arduino is as easy as that. Processing, however, is a much broader programming environment and therefore hooking up to a serial port must be done manually. The following code shows how to do this:
// Serial communication in Processing 1.0 // Import the processing serial libraries import processing.serial.*; // Declare a serial port: Serial myPort; // List all available serial ports: println(Serial.list()); /* Open whatever port is the one you're using. Mine is zero, hence Serial.list()[0]. Also, 9600 is the bps (bits per second) of the connection. */ myPort = new Serial(this, Serial.list()[0], 9600); // Send an E to the serial port. 69 is the ASCII value for capital E. myPort.write(69);
I would imagine that something similar to the above block of code is actually running when selecting the serial port from the drop-down menu in the case of the Arduino IDE. Also worth mentioning is that when using the Arduino IDE, the serial libraries have already been included, and therefore do not have to included manually as was the case with Processing.