I’ve made a small patch in Pure Data to scan all the serial ports until an Arduino board with Firmata is found. It uses Firmata and the [arduino] object for Pd written by Hans-Christoph Steiner.
Depending on the platform you’re using and the way the board was installed, the port used by your Arduino may not be very intuitive. With this patch your Arduino is found and the port open automatically at startup. You can send any message you want to the [arduino] object (like messages to open certain pins for input).
The patch does the trick by trying to open every port between 1 and 10 and asking for the firmware (which only an Arduino board on which Firmata was loaded can provide). If it gets a firmware version in response it stops scanning and a suitable Arduino has been found.
Here’s the inside of the abstraction :
And here’s the main patch:
You can download the patch here.