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.
Dependents: STM32F030R8_SOMO-14D
You are viewing an older revision! See the latest version
SOMO 14D Function Library Usage
List of SOMO-14D Functions Usage¶
SOMO14DisBusy¶
The function SOMO14DisBusy() checks if the busy pin is high, that means the device is playing audio
SOMO14DisBusy()
int main() { while(1) { . . if (!SOMO14DisBusy()) { /* Check if SOMO is doing something */ // Do something } . . } }
SOMO14DInit¶
The function SOMO14DInit() initialize the module and set a callback function triggered when the device finish to play a song. SOMO14DInit() must be called before any other SOMO function.
SOMO14DInit()
void SOMO14DISR(void); int main() { SOMO14DInit(SOMO14DISR); /* Set up the sound module pins */ while(1) { . . . . } } void SOMO14DISR(void) { // Do something when the audio finish }
SOMO14DPause¶
The function SOMO14DPause() makes two actions... holds the current song and if toggled resumes to the current song.
SOMO14DInit()
int main() { SOMO14DInit(); while(1) { // when received a char do the next thing... switch (data) { case 'h': SOMO14DPause(); /* Hold or resumes the song */ break; } } }