Hello World for the Nucleo soundboard library
Dependencies: WTV020SD_Sound_Breakout_Library mbed
main.cpp
- Committer:
- ejteb
- Date:
- 2014-11-02
- Revision:
- 0:b6e1b3c47ecc
File content as of revision 0:b6e1b3c47ecc:
#include "mbed.h" #include "soundboard.h" int main(void) { //initialise the soundboard soundboard mySoundBoard(D1, D2, D3, D4); //play track 0 mySoundBoard.play(0); //play track 1 mySoundBoard.playAsync(1); //set the volume as 3 mySoundBoard.setVolume(VOL_3); wait(.5); //set the volume as 7 (max) mySoundBoard.setVolume(VOL_7); wait(.5); //mute the playback, but the playback will continue mySoundBoard.setVolume(MUTE); wait(.5); //pause playback mySoundBoard.pause(); wait(.5); //continue playback mySoundBoard.pause(); wait(.5); //reset the soundboard. mySoundBoard.reset(); while(1); }