Real Time Lab Program

Dependencies:   USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "USBMIDI.h"
00003 
00004 USBMIDI midi;                        // initialise MIDI interface
00005 
00006 int i;
00007 
00008 int main() {             
00009     while (1) {    
00010         for(i=48; i<72; i++) {                     // step through notes 48 to 120
00011             midi.write(MIDIMessage::NoteOn(i));    // note on
00012             wait(0.2);                             // pause
00013             midi.write(MIDIMessage::NoteOff(i));   // note off  
00014             wait(0.2);                             // pause
00015         }
00016     }
00017 }