hi
sounds like you are in the best position to solve it... I can't think of anything else that might have gone wrong.
So you are back to the age-old, tried-and-true method of troubleshooting: persistence.
You might want to figure out where the communication stops. Here are two simple ways to locate the point where that point is.
On the Max side: put some print statements ( after the serial object) in the Max patch to see if you are really not geting anything back.
On the Arduino side: to test if data is being received by the Arduino, add this to the Ardunio2max code:
// an LED connected to pin 13 and this code tells us if Arduino is receiving control codes from MAX.
digitalWrite(13,HIGH);
delay(500);
digitalWrite(13,HIGH);
delay(200);
so that it looks like this:
if (messageBuild()) { // Checks to see if the message is complete
firstChar = messageGetChar(); { // Gets the first word as a character
if (firstChar = 'r') { // Checking for the character 'r'
secondChar = messageGetChar(); // Gets the next word as a character
if (firstChar = 'd') // The next character has to be 'd' to continue
messageSendChar('d'); // Echo what is being read
// an LED connected to pin 13 and this code tells us if Arduino is receiving control codes from MAX.
digitalWrite(13,HIGH);
delay(500);
digitalWrite(13,HIGH);
delay(200);
for (int i=0;i<=5;i++) {
messageSendInt(analogRead(i)); // Read analog pins 0 to 5
}
for (int m=2;m<=13;m++) {
messageSendInt(digitalRead(m)); // Read digital pins 2 to 13
}
messageEnd(); // Terminate the message being sent
delay(100);
d