MAX MSP and Arduino Can't figure out communication Problem


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.


Arduino Code:

int incomingByte = 0;
void setup() {

pinMode(6, OUTPUT);
void loop ()

if (Serial.available() > 0) {

incomingByte =;

if (incomingByte == 60) { // digital pin 0
digitalWrite(6, HIGH);

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


pic hosting