Rob Toulson
/
RealTimeLab06_MIDIoutput
Real Time Lab Program
Diff: main.cpp
- Revision:
- 0:8babbd3cdb4b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jan 25 16:29:02 2015 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "USBMIDI.h" + +USBMIDI midi; // initialise MIDI interface + +int i; + +int main() { + while (1) { + for(i=48; i<72; i++) { // step through notes 48 to 120 + midi.write(MIDIMessage::NoteOn(i)); // note on + wait(0.2); // pause + midi.write(MIDIMessage::NoteOff(i)); // note off + wait(0.2); // pause + } + } +}