Send data to Max MSP from a button attached to Arduino

Javi Hache's icon

I don't know what I'm doing wrong and I've searched everywhere. I have an Arduino Duemilanove, Max for Live 5, Live 8.3 and a Button :)

I need to send a bang to Max from the Arduino when the button is pressed. I tried Maxuino, it doesn't receive any bangs when I short any of the Pins after following the instructions by Maxuino and some other webpages. The PinRead mode is like not working, although I can light up the LED on pin 13 from Max.

Arduino2Max which seems the simplest solution is also not working, since the code provided for the Arduino is outdated and the Arduino program doesn't accept a variable called BYTE anymore. It recommends you to substitute with Serial.write () but I don't know what value goes between brackets, tried a few between 1 and 32 and none made the thing read the pins.

So what to do? The idea is that when the button is pressed Max should get a bang, that then can be transformed into MIDI or OSC or whatever, but first I really need to read something from the Arduino.

Thanks in advance!

brendan mccloskey's icon

Hi
Going by the number of posts here requesting help with these prefabs, if you (or anyone) is new to Arduino and Max I would not recommend trying to hack Maxuino or Arduino2Max for your own needs until you've learned the basics:

Arduino/File/Examples/Digital/Button

Brendan

Mattijs's icon

Try this instead of Arduino:

It comes with a Max external.

It was as easy as plugging it into my usb port, installing the driver, starting the max help patch and then shortcutting the digital input (green and yellow line) gives me a 1 message.

Jan M's icon

+1 bookmarked!

Javi Hache's icon

Nice that looks good Mattijs! However I made it, and would like to post the changes in the Arduino code necessary to actually be able to receive info with Arduino2Max on Max and Max for Live. I had to change a couple of things from the original code, but as soon as u load this on the arduino, open de Arduino2Max patch, click on start and u are ready to go.

Optionally u can open the patcher inside the main window to which the Toggle is connected and change the metro to get data faster.

Try it, it works!!

4069.Arduino2MaxWDigOutMod4Max5.ino
ino