Reproduce wave desde SD Card a pin análogo de salida
Dependencies: SDFileSystem mbed wave_player
Fork of WavePlayer_HelloWorld by
Diff: main.cpp
- Revision:
- 2:f06db47e56e3
- Parent:
- 1:5b8e223e983d
- Child:
- 3:a11202fce37c
diff -r 5b8e223e983d -r f06db47e56e3 main.cpp --- a/main.cpp Thu Jan 24 02:59:05 2013 +0000 +++ b/main.cpp Mon May 15 21:57:08 2017 +0000 @@ -1,20 +1,18 @@ - #include "mbed.h" #include "SDFileSystem.h" #include "wave_player.h" -SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card +SDFileSystem sd(PTD2, PTD3, PTD1, PTD0, "sd"); //pines SD card -AnalogOut DACout(p18); +AnalogOut DACout(PTE30); //pina analogo de salida -wave_player waver(&DACout); +wave_player parlante(&DACout); // salida wave al pin de salida int main() { - FILE *wave_file; - printf("\n\n\nHello, wave world!\n"); - wave_file=fopen("/sd/sample.wav","r"); - waver.play(wave_file); - fclose(wave_file); + FILE *audio; + audio=fopen("/sd/audio1.wav","r"); + parlante.play(audio); + fclose(audio); } \ No newline at end of file