Go Down

Topic: MAX MSP and Arduino Can't figure out communication Problem (Read 701 times) previous topic - next topic

rel

Hello,

I'm new to using max with arduino.  I'm not sure where I'm going wrong here, but I'm trying to print the numbers from the midi file and send them to the arduino.  I've assigned a different number for each pin.  I know I have a solid serial connection because pins 0 and 1 are active retrieving data.  I know it's probably something simple, but if anyone has an idea let me know.

Thanks!

Arduino Code:

int incomingByte = 0;
void setup() {
 

  Serial.begin(9600);
  pinMode(6, OUTPUT);
}
void loop ()
{
 
  if (Serial.available() > 0) {
   
    incomingByte = Serial.read();
  }
   
   
    if (incomingByte == 60) { // digital pin 0
      digitalWrite(6, HIGH);
    }

    if (incomingByte == 52) {
        digitalWrite(6, LOW);
      }

}


pic hosting

Go Up