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.
Dependencies: 4DGL-uLCD-SE USBHostMIDI mbed
Fork of USBHostMIDI_example by
Revision 3:d48372c1347e, committed 2017-12-13
- Comitter:
- kjones99
- Date:
- Wed Dec 13 17:17:07 2017 +0000
- Parent:
- 2:5366ce17fe55
- Commit message:
- Final version with comments.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5366ce17fe55 -r d48372c1347e main.cpp
--- a/main.cpp Wed Dec 13 03:31:09 2017 +0000
+++ b/main.cpp Wed Dec 13 17:17:07 2017 +0000
@@ -11,14 +11,8 @@
-
-//void notesound_t(unsigned char note, unsigned char velocity, volatile int time_us) {
-// myspeaker.PlayNote(note, velocity, time_us);
-//}
-
-
void noteOn(unsigned char channel, unsigned char note, unsigned char velocity) {
- wdt.kick(3.0);
+ wdt.kick(3.0); //start watchdog timer
myled = 1.0; //turn on LED1 on note press
myspeaker.PlayNote(note, velocity);
//uLCD.printf("\nkey: %d, velocity: %d\r\n", note, velocity);
@@ -60,24 +54,18 @@
}
int main() {
- if ((LPC_WDT->WDMOD >> 2) & 1)
+ if ((LPC_WDT->WDMOD >> 2) & 1) //indicate if watchdog timer has not been kicked, and resets mbed
myled4 = 1; else myled3 = 1;
- //wdt.kick(3.0); //use watchdog timer to reset mbed after 2 seconds without kick
uLCD.background_color(BLUE); //set background for spectrum analyzer
uLCD.cls();
uLCD.line(5,110,120,110,WHITE); // x-axis
uLCD.line(5,5,5,110, WHITE); //y-axis
- //uLCD.fill(65,35,55,1,graphAxesColor);
- //uLCD.fill(65,35,1,85,graphAxesColor);
Thread midiTask(midi_task, NULL, osPriorityNormal, 256 * 4);
while(1) {
Thread::wait(50);
//wdt.kick();
- myled4=!myled4;
- //uLCD.printf("This is a test\n");
- //myspeaker.PlayNote(60, 127, 1.0);
-
+ myled4=!myled4; //blink LED4 to indicate that mbed is ready to receive input from keyboard
}
}
\ No newline at end of file
