Problem with the call and response max/arduino example …

Apr 21, 2012 at 9:10pm

Problem with the call and response max/arduino example …


I have made the following max / arduino tutorial:

Yes, it works, the sensor data comes out into the three number boxes, but there is a problem:
- everytime I hook up the arduino, the sensor signals appear in different number boxes. This means that I need to find out which sensor comes out into which number box, everytime I boot max.

My question is: How do I make sure that the sensor signal from A1 is routed into the first number box, the sensor signal A2 is routed into the second number box etc, everytime I open max?

Thanks for your help!


Apr 21, 2012 at 9:25pm

prefix each sensor with a unique ID:

Serial.print(“1″);//ascii 49
Serial.print(yourOwnSensorValueHere, BYTE);
Serial.print(“2″);//ascii 50
Serial.print(anotherSensorValueHere, BYTE);


then in Max use a combination of [zl group 2] and [route 49 50]. This very short video of mine explains how:

just replace the random val1, random val2 etc with your own sensor values

Brendan (fCast)

Apr 24, 2012 at 12:55am

The reason this is happening is because the Arduino is pinging the attached computer waiting for a serial port to open, there’s a byte sitting in the buffer, causing everything to shift over one.

Thanks for pointing this out, I’ll address it for the next Arduino software release.

Apr 24, 2012 at 1:24am

Here’s a patch that addresses the issue for that specific example. If you have trouble, please let me know.

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.