I am using an Arduino Duemilanove and some pots / buttons to control a Max patch. However, for seemingly no reason, there are some times that either Max freezes up as I open the serial connection, or one of my peripherals (mouse or keyboard, USB and bluetooth) stop communicating with my computer. The latter problem seems to indicate that it's the serial connection that is the issue.
I'm using almost exactly the suggested Arduino to Max patch, modified only to allow for more inputs (attached). The problem occurs when using the attached patch both by itself and as a subpatch.
I am on Mac OS 10.7, with Max 5.1.7, on a 2010 (possibly?) iMac. I'm not certain what other information I can include, but if any more is needed, please ask.
To reproduce problem:
1. Plug in Arduino through USB port.
2. Send Arduino the attached code.
3. Once code is fully received by Arduino, hit the top toggle in the attached Max patch.
At this point, Max would sometimes freeze, with the toggle remaining in the off position. (Max would then fail to start up again, even with the shift-click trick. It would get as far as showing the bold "MaxMSP" menu header in the top left of the screen, but would get stuck with the spinning beach ball.)
At other times, my mouse or keyboard would cease to work, but the controller would continue working (if my memory is correct: I can't seem to reproduce the bug at this moment, of course... :) ). Some times, the mouse or keyboard would start working again once Max was quit; other times, a restart fixed it.