Make noise with a piezo buzzer. Use a pwm pin.
Fork of beep by
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 Sun Jul 17 2022 05:13:32 by 1.7.2