![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Shell code for the Tanks game
Dependencies: 4DGL-uLCD-SE EthernetInterface Game_Synchronizer MMA8452 SDFileSystem mbed-rtos mbed wave_player
misc/misc.cpp
- Committer:
- jford38
- Date:
- 2015-10-30
- Revision:
- 26:317310d660b2
- Parent:
- 23:77049670cae6
File content as of revision 26:317310d660b2:
#include "misc.h" #include "uLCD_4DGL.h" #include "SDFileSystem.h" #include "wave_player.h" extern uLCD_4DGL uLCD; extern wave_player player; // Given the filename of a .wav file in the SD card, play the file over the speaker. void playSound(char * wav) { // open wav file FILE *wave_file; wave_file=fopen(wav,"r"); if(wave_file == NULL){ uLCD.locate(0,4); uLCD.printf("Error in SD"); return; } // play wav file player.play(wave_file); // close wav file fclose(wave_file); }