MBed reading MIDI data

11 May 2010

I'm trying to read data from a MIDI controller using this:

Serial pc(USBTX,USBRX);
Serial keyboard(p13,p14);
DigitalOut myled(LED3);
void baud(31250);

char c;

int main() {

pc.printf("If you want to see the MIDI code of the keyboard press 'b' or press 'e' if you don't want to be interrested in MIDI code");

c = pc.getc();




while ((c == 'b') || (c == 'B')) {
pc.putc(keyboard.getc());
myled = 1;
c = pc.getc();


}

 

I would like to use the mbed to control the brightness of LEDS via PWM using a MIDI controller keyboard as the input.