USBMIDI Hello World

Dependencies:   mbed USBDevice

main.cpp

Committer:
samux
Date:
2011-11-11
Revision:
3:7990c80e953c
Parent:
2:4505f7d7196e

File content as of revision 3:7990c80e953c:

// Hello World example for the USBMIDI library

#include "mbed.h"
#include "USBMIDI.h"

USBMIDI midi;

int main() {             
    while (1) {    
        for(int i=48; i<83; i++) {     // send some messages!
            midi.write(MIDIMessage::NoteOn(i));
            wait(0.25);
            midi.write(MIDIMessage::NoteOff(i));
            wait(0.5);
        }
    }
}