waverplayer RTOS demo - at present time older libraries were needed to avoid SD open errors - so don't update them
Dependencies: SDFileSystem_OldbutworkswithRTOS mbed-rtos mbed wave_player
Fork of WavePlayer_HelloWorld by
This is a demo of the waveplayer using the RTOS on an SD card. I had to use older libraries to get it to work as of 4/18/17 on the LPC1768. Updating libraries adds a lot of compiler warnings about filesystem stuff, and it seems to cause SD card open errors.
main.cpp
- Committer:
- 4180_1
- Date:
- 2017-04-18
- Revision:
- 2:c2afd0c426af
- Parent:
- 1:5b8e223e983d
File content as of revision 2:c2afd0c426af:
#include "mbed.h" #include "rtos.h" #include "SDFileSystem.h" #include "wave_player.h" SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card AnalogOut DACout(p18); wave_player waver(&DACout); int main() { FILE *wave_file; printf("\r\n\nHello, wave world!\n\r"); Thread::wait(1000); wave_file=fopen("/sd/sample.wav","r"); if(wave_file==NULL) printf("file open error!\n\n\r"); waver.play(wave_file); fclose(wave_file); }