help with arduino multiple messages

Jul 6, 2011 at 8:43pm

help with arduino multiple messages

I been banging my head trying to figure it out how to get
max msp to unpack 2 sensors data.

here is my max patch fallow by arduino stech.
any help is welcome

– Pasted Max Patch, click to expand. –

arduino code


int potPin = 5; // select the input pin for the potentiometer
int potpin2 = 2;
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
int val2 =0;
void setup() {


void loop() {
val2 = analogRead(potpin2);
val = analogRead(potPin); // read the value from the sensor

delay (10);

delay (10);


Jul 6, 2011 at 10:56pm

You can add an index before the value in your arduino script :

Serial.print(“1 “);

and respectively :
Serial.print(“2 “);

and in your max patch you add a route object:

– Pasted Max Patch, click to expand. –


Jul 6, 2011 at 11:10pm

Or you could use Jan’s method of a Serial.print followed by a Serial.prinln to put both values in the same serial message and then use unpack to get the results in Max.

Jul 13, 2011 at 12:26am

looks like it works.
thanks guys


You must be logged in to reply to this topic.