Make noise with a piezo buzzer. Use a pwm pin.
Dependents: Cave_Runner popcorn default USBMIDI_Buzzer ... more
mbed Namespace Reference
class to make sound 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...
Detailed Description
class to make sound 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 with 1Khz for 0.5 seconds #include "mbed.h" #include "beep.h" Beep buzzer(p21); int main() { ... buzzer.beep(1000,0.5); ... }
Generated on Tue Jul 12 2022 17:09:22 by
![doxygen](doxygen.png)