MaxMsp: How to Output to Arduino?

Hi everyone!

I have worked with using sensors attached to arduino to feed in information to MaxMsp; I would like to know how to do it the other way around now.

How would I use MaxMsp to output to arduino, say, turn an LED on. Also where would I attached the LED to the arduino?

Thanks in advance,

Sol.

Hi Im working with the Arduino2Max patch and its working well. http://www.arduino.cc/playground/Interfacing/MaxMSP if you read carefully the author states

Arduino2Max only reads the Arduino's inputs, although with some work serial writes would be possible. Feel free to improve on what you find here and repost it with a higher version number.

Unfortunately im not to good with serial stuff...good luck.

i was reading a little further and daniel outlines some possibilities here...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1170506211

Use the serial object. Probably best to send an indexed two-item list: (1 1) = turn on LED 1; (4 0) = turn LED 4 off. In the Arduino code you'd look for serial.read() and parse accordingly, then set your digital pins high / low. If you're using analog (like to control a motor or something) the idea is the same, mostly. (I'm no expert though)

I've used this to run LEDs as well as lasers. Set a metro in your Max code to toggle them on and off. You can get really fast, so fast you don't notice the blink. When it's this fast you can use this to simulate dimmer levels than "constant on"... like on / off 80% / 20% would be 4 on, 1 off. At a speed of about 5 ms it'll just look dimmer, not flickery.

You don't need the Arduino2Max object for this, just the included serial object. But the Arduino2Max is very handy indeed... takes all the work out of making indexed lists that the serial object often has trouble reading correctly (the index getting swapped with the data value and vice versa). Thanks for that object!!

CJ