Serial connection from Arduino to Processing using Mac OS

First of all a Serial-USB-Driver needs to be installed. The driver of choice is called FTDIUSBSerial-Driver and as of version 2.2.16 for Mac OS can be used on Lion, even if it says otherwise. Restarting the computer after the installation is recommended.

Now create a new serial connection in Processing:

import processing.serial.*;
Serial port;
port = new Serial(this, Serial.list()[0], 57600);

Serial.list() gives you an array of all available serial ports on your Mac. In most cases index 0 is your choice. However you can specify the serial port with it's actual name, e.g. /dev/tty.usbserial-A6008e1I. A list of all USB-serial-devices on your Mac can be retrieved by entering following line in your Terminal.

ls -l /dev/*.usbserial-*

Compiling your Processing program you'll probably get an error called RXTX Version mismatch. To fix this, you'll need to replace two files in the Download the RXTX from the RXTX-Wiki.

Show the package contents of the The files that need to be replaced with the ones from the RXTX library download can be found here:

Compiling you Processing-code once again, now you shouldn't get the RXTX version mismatch anymore. Perhaps you will get an exception called Fixing this is easy: just run these commands in your Terminal:

sudo mkdir /var/lock
sudo chmod 777 /var/lock

Now the serial connection from Processing to the Arduino should work fine.