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: mbed Watchdog SDFileSystem DigoleSerialDisp
Beep Class Reference
Generates a tone with a buzzer, based on a PwmOut The class use a timeout to switch off the sound - it is not blocking while making noise. More...
#include <Beep.h>
Public Member Functions | |
| Beep (PinName pin) | |
| Create a Beep object connected to the specified PwmOut pin. | |
| void | beep (float frequency, float time) |
| Beep with given frequency and duration. | |
| void | nobeep () |
| stop the beep instantaneously. | |
Detailed Description
Generates a tone with a buzzer, based on a PwmOut The class use a timeout to switch off the sound - it is not blocking while making noise.
Example:
// Beep at 2kHz for 0.5 seconds #include "mbed.h" #include "Beep.h" Beep buzzer(p21); int main() { ... buzzer.beep(2000,0.5); ... }
Definition at line 24 of file Beep.h.
Constructor & Destructor Documentation
| Beep | ( | PinName | pin ) |
Member Function Documentation
| void beep | ( | float | freq, |
| float | time | ||
| ) |
Generated on Tue Jul 12 2022 21:36:19 by
1.7.2