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.
Dependencies: C12832 MMA7660 mbed
sound.cpp
- Committer:
- ksaito
- Date:
- 2018-01-31
- Revision:
- 0:c3bc6981ad28
- Child:
- 1:2967eac08981
File content as of revision 0:c3bc6981ad28:
#include "mbed.h"
PwmOut spkr(p26);
void SoundInitialize(void) {
spkr=0.0;
}
void SoundProcess(void) {
for (float i = 2000.0; i < 10000.0; i += 100) {
spkr.period(1.0 / i);
spkr = 0.5;
wait(0.1);
}
}
void SoundFinalize(void) {
SoundInitialize();
}