I have the following MIDI breakout board
I am finding it hard to even verify if it is working with my Arduinos, I'd prefer to test on a MEGA 2560, but just because the following code was for an UNO, I fully mounted it on the UNO:
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
// -----------------------------------------------------------------------------
// This example shows the old way of checking for input messages.
// It's simpler to use the callbacks now, check out the dedicated example.
#define LED 13 // LED pin on Arduino Uno
// -----------------------------------------------------------------------------
void BlinkLed(byte num) // Basic blink function
{
for (byte i=0;i<num;i++)
{
digitalWrite(LED,HIGH);
delay(50);
digitalWrite(LED,LOW);
delay(50);
}
}
// -----------------------------------------------------------------------------
void setup()
{
pinMode(LED, OUTPUT);
MIDI.begin(); // Launch MIDI, by default listening to channel 1.
}
void loop()
{
if (MIDI.read()) // Is there a MIDI message incoming ?
{
switch(MIDI.getType()) // Get the type of the message we caught
{
case midi::ProgramChange: // If it is a Program Change,
BlinkLed(MIDI.getData1()); // blink the LED a number of times
// correponding to the program number
// (0 to 127, it can last a while..)
break;
// See the online reference for other message types
default:
break;
}
}
}
That is simply the MIDI.h Basic "Input" program.
I do not see the bulit in LED respond to MIDI when I upload this program and connect my Keyboard which is definitely sending MIDI on MIDI port 1, to the IN port of the breakout board. As I said, Fully Mounted as a shield, as well as mounted with the correct wires in the correct sockets, and I have tried with a MEGA 2560 and UNO, and still no response. TX from shield to RX on Arduinos and RX from shield to TX on Arduinos, 5v to 5v and GND to GND.
Is there something I could be missing?
The TX light on the Arduinos actually flashes when I create any MIDI event with my keyboard. If I reverse the TX and RX wires then nothing happens.



