Instead of holding the songs on a SD card, this one is for a USB stick

Dependencies:   WavPlayer mbed C12832 MSCFileSystem WavPlayerSD

Files at this revision

API Documentation at this revision

Comitter:
JostBaus
Date:
Sun Apr 14 16:23:55 2019 +0000
Parent:
3:eb77b82ce461
Child:
5:166fa9e3c8e3
Commit message:
Changed pins to match the circuit board, replaced the wav_player.h lib with another one

Changed in this revision

WavPlayer.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
wave_player.lib Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WavPlayer.lib	Sun Apr 14 16:23:55 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/p07gbar/code/WavPlayer/#b0186c8dca92
--- 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) {
--- a/wave_player.lib	Mon Apr 01 11:34:23 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/users/sarthakjaiswal/code/wave_player/#bd0772f13bc8