Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "USBMIDI.h" 00003 00004 USBMIDI midi; // initialise MIDI interface 00005 DigitalOut LED(p25); 00006 DigitalIn Switch(p14); 00007 AnalogIn Ain(p20); 00008 00009 int main(){ 00010 while (1) { 00011 if (Switch==1) { 00012 int note = 48+72*Ain; // calculate note value 00013 midi.write(MIDIMessage::NoteOn(note)); // note on 00014 wait(0.2); 00015 midi.write(MIDIMessage::NoteOff(note)); // note on 00016 LED=0; 00017 } 00018 else { 00019 LED=1; 00020 } 00021 } 00022 }
Generated on Mon Jul 18 2022 20:09:12 by
1.7.2