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: WavPlayer mbed C12832 MSCFileSystem WavPlayerSD
Diff: main.cpp
- Revision:
- 4:efd586e5c9a7
- Parent:
- 3:eb77b82ce461
- Child:
- 6:ea92f15a3798
--- a/main.cpp Mon Apr 01 11:34:23 2019 +0000 +++ b/main.cpp Sun Apr 14 16:23:55 2019 +0000 @@ -3,7 +3,7 @@ #include "stdio.h" #include "math.h" #include "C12832.h" -#include "wave_player.h" +#include "WavPlayer.h" #include "SDFileSystem.h" #include <string> using namespace std; @@ -11,20 +11,19 @@ //Communication\interfaces Serial pc(USBTX,USBRX); //USB serial C12832 lcd(p5, p7, p6, p8, p11); //LCD -SDFileSystem sd(p5, p6, p7, p8, "sd"); //SDCard -DigitalIn sdDetect(p17); //CardDetect +SDFileSystem sd(p11, p12, p13, p15, "sd"); //SDCard +DigitalIn sdDetect(p14); //CardDetect //in- and outputs DigitalIn PauseBtn(p21); DigitalIn StopBtn(p22); //joystick -BusIn joy(p15,p12,p13,p16); +BusIn joy(p19,p17,p18,p20); DigitalIn joyBtn(p14); //DAC output -AnalogOut DACout(p18); -wave_player waver(&DACout); //set up DAC to use wave player library +WavPlayer waver; //set up DAC to use wave player library //timer @@ -105,7 +104,8 @@ lcd.locate(0,0); lcd.printf("Now playing"); wave_file = fopen(fname.c_str(),"r"); //opens the music file - waver.play(wave_file); //plays the music file + waver.open(wave_file); + waver.play(); //plays the music file lcd.locate(0,10); lcd.printf("%s", (songs[m])); while(Stopped == 0) {