ARDUINO MEGA WITH MAX MSP ?!

Oct 5, 2010 at 8:49am

ARDUINO MEGA WITH MAX MSP ?!

I am having trouble with getting my Arduino Mega to work with ALL the pins. I have been using “Arduino2MAX_V.4″. This is the link: http://www.arduino.cc/playground/Interfacing/MaxMSP
….. BUT I cant get the analog pins to work with max beyond pin # 5.
I have posted help also here:

http://forums.adafruit.com/viewtopic.php?f=8&t=17522&p=89456#p89456

#52569
Oct 5, 2010 at 2:35pm

are all the analog inputs enabled in the arduino code? You might have the script for a smaller arduino uploaded to the mega.

S

#189090
Oct 5, 2010 at 3:01pm

The code example you linked to (adafruit):

void loop()
{

if (Serial.available() > 0){ // Check serial buffer for characters

if (Serial.read() == ‘r’) { // If an ‘r’ is received then read the pins

for (int pin= 0; pin< =5; pin++){ // Read and send analog pins 0-5
x = analogRead(pin);
sendValue (x);
}

for (int pin= 2; pin< =13; pin++){ // Read and send digital pins 2-13
x = digitalRead(pin);
sendValue (x);
}

does not appear, as you say, to be altered to read all pins; but even changing this may not allow you to read all pins if the Arduino2Max patch is not set up to parse data from all pins. If you have changed the Arduino code to read all pins and the problem persists then you’re going to have to also change the Max patch, if it’s open-able?
The poster above is right, you’ve probably got hold of a patch and some code that was designed for the Duemilenova-type board.
Brendan

#189091
Oct 5, 2010 at 4:28pm

Yes this code is for a normal Arduino … This is NOT the changed code. This is what I changed:

for (int pin= 0; pin< =15; pin++){ // Read and send analog pins 0-5
x = analogRead(pin);
sendValue (x);

BUT I cannot find code anywhere for a Mega to Max

#189092
Oct 5, 2010 at 4:48pm

Can you open and edit the Max patch?

#189093
Oct 5, 2010 at 6:27pm

yes

#189094
Oct 5, 2010 at 7:13pm

Ok, then you should post a stripped down version of the unlocked original patch (assuming you’ve already done some tinkering with it).

I’m guessing that, given your changes to the Arduino sketch, the problem lies in the Max patch.

Would you describe yourself as a beginner/intermediate/advanced Max5 programmer?

Brendan

#189095
Oct 5, 2010 at 7:35pm

Max5 … Beginner // Arduino … intermediate. I am able to edit the patch in Max but im not sure how / if it is possible to go further down to the “code” level

#189096
Oct 5, 2010 at 7:49pm

Well
let’s have a look at the patch then……..if it’s not locked and uneditable, as is an exernal object or bpatcher, it should be fairly straightforward to extend the Max patch to include your additional inputs.

BTW just out of curiosity, how many analog inputs do you need and what are you using them for?

Brendan

#189097
Oct 5, 2010 at 8:29pm

SUCESS !!!! I edited the Max patch within the other patch and everything is working !!! Thanks for your help….

#189098

You must be logged in to reply to this topic.