Multiple Analog Values from Arduino to Pd/MAX

Hi All,

I’m new to arduino and I’ve got quite an optimistic project on the go that uses 12 x proximity sensors at once (sharp GP2Y0A02YK0F) for use with MAX MSP. I went and bought an arduino mega2650 as it has 16 analog inputs.

After following this tutorial: http://colinzyskowski.com/?page_id=503 it was all working fine with 3 inputs, but when I try to add a 4th there doesn’t seem to be any data coming in. I’m thinking this might be because there’s a limit to how much data can be sent using Serial.write, however on the tutorial he states if you just add int val4; analogRead(3); val4 = map(val4, 0, 1023, 301, 400); and Serial.write(val4); to the Arduino code I should be able split/parse the data back in Max as I have done with the previous 3 sensors.

Is there a better way to get 12 streams of data from the Arduino into Max? Has anyone encountered any similar issues?

Thanks in advance!

Jack

Is there a better way to get 12 streams of data from the Arduino into Max?

Better than what?

(Hint: this is the Programming section of the forum. Don't forget the code tags)

Post your code, let's see how you're reading the analog inputs and passing the data along.
The output just sits at some DC-ish level, yes?

So do 12 reads, stick them in an unsigned int array, and send the data out.