midi input to arduino

can't get this to work... I'm using the standard opto-isolator circuit which I've gotten to work with PICs previously.

my program right now is pretty simple, just lights up an LED if a noteOn message is detected...

void light();
void setup() {
  beginSerial(31250);
  pinMode(13, OUTPUT);
}
void loop() {
  if(serialRead() == 144) {
    light(13);
  }
}
void light(pinNum) {
  digitalWrite(pinNum, HIGH);
  delay(1000);
  digitalWrite(pinNum, LOW);
  delay(1000);
}

In terms of error checking:

  1. I know my MIDI device is transmitting on the correct channel
  2. There is output from my opto-isolator
  3. My LED is plugged in the right way :slight_smile:

One question I had was about the serial connection... I have a USB board. In order to receive MIDI I am using the following hookup order.

  1. Upload the program with the MIDI output disconnected from the serial header.
  2. Unplug the USB connection (external power is plugged in)
  3. Plug the MIDI output into the serial receive header
  4. Reset Arduino
  5. Test program (unsuccessfully).

Does this seem like the correct sequence?

Thanks for any help. I'm really enjoying using the board so far. - Charlie