Tutorial for modifying Arduino2Max to output to Arduino from Max

nilloc's icon

I've been working on this and thought I'd post it for everybody. Arduino2Max is really lightweight, but doesn't allow for output from Max to Arduino. This uses a crude but functional method to get data flowing the other way.

Example Arduino code and Max patch included as well as a basic (i.e., for beginners) PDF tutorial.

Thought this might be useful for somebody in the future searching the forum.

2763.ArduinoandMaxSerialCommunication.pdf
pdf
artradio's icon

Wow! Exactly what I was looking for.

I'm finally at a place where I'm comfortable programming with Max, but navigating Arduino has been slow. Thank you for adding this simple workaround to something that I've already spent hours trying to figure out.

nilloc's icon

I'm glad it's helpful. You should check out Maxuino if you don't want to mess with Arduino at all. I posted a Maxuino tutorial on the forum a few days ago too. I've been having a bit of trouble with it in Windows, but on Mac it's great.

benoit-1842's icon

To download the arduino code they ask me for a password ?

nilloc's icon

The Arduino code linked to at the beginning the tutorial just from the Max Serial Communication tutorial (https://cycling74.com/docs/max5/tutorials/max-tut/communicationschapter02.html). That part of my tutorial is just to make sure people understand how serial communication works.

My modifications to Arduino2Max can be accessed through the second link above, which is also found further down in the tutorial. I'll try to upload a modified version of the tutorial to change that link at the beginning.

nilloc's icon

I thought I'd be able to edit the original post, but it looks like I can't. Here's an updated version of the tutorial.

2786.ArduinoandMaxSerialCommunication1.pdf
pdf
capcaunu's icon

Hi,

I'm completely new to MAX/MSP and I've been trying to follow the tutorial about serial communication: "Max Comm Tutorial 2: Serial Communication". Funny thing happens: if I have my Arduino plugged into the USB, the "print" button on top of the tutorial patcher won't "press". It looks frozen, and the L LED on the board flashes fast twice. Also, the tutorial says " the available serial ports on your computer will appear in the Max window, along with their letter mappings." but nothing appears. I'm using Arduino Duemilanove, if that counts for anything, and Maxuino worked on the same computer& board. I was able to turn digital pins HIGH and LOW and light some LEDs.

Now back to the sketch.
If I unplug Arduino, then the button looks like it's being pushed down when I click it.

I'm not sure if this is normal behaviour or if I need to update something on my system in order for MAX/MSP to work properly.

Any help is much appreciated. Thank you!
Cristian

3227.clickingonPRINT.jpg
jpg
nilloc's icon

I have no idea why the print message is behaving that way. Sorry I can't help.

div's icon

This is great though I can't find any way to send larger values or negative numbers via serial to the Arduino.

Any ideas?