Real Time Lab Program

Dependencies:   USBDevice mbed

main.cpp

Committer:
robt
Date:
2015-01-25
Revision:
0:8babbd3cdb4b

File content as of revision 0:8babbd3cdb4b:

#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
        }
    }
}