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
PIEZO_BZ Class Reference
Piezo Buzzer class. More...
#include <piezo_bz.h>
Public Member Functions | |
| PIEZO_BZ (PinName pin, uint32_t freq, uint32_t on_off_time) | |
| Create a Piezo Buzzer instance. | |
| virtual | ~PIEZO_BZ () |
| Destructor of Piezo Buzzer. | |
| void | start (void) |
| Start Buzzer. | |
| void | stop (void) |
| Stop Buzzer. | |
| void | change_frequency (uint32_t freq) |
| Change buzzer frequency. | |
| void | change_on_off (uint32_t on_off_time) |
| Change On-Off duration. | |
Detailed Description
Piezo Buzzer class.
Definition at line 50 of file piezo_bz.h.
Constructor & Destructor Documentation
| PIEZO_BZ | ( | PinName | pin, |
| uint32_t | freq, | ||
| uint32_t | on_off_time | ||
| ) |
Create a Piezo Buzzer instance.
- Parameters:
-
pin for Piezo Buzzer (another pin connect GND) Buzzer frequency [Hz] Duration for ringing time and rest time (duty 50%) [mS] on_off_time = 0 -> Continuous mode
Definition at line 15 of file piezo_bz.cpp.
| ~PIEZO_BZ | ( | ) | [virtual] |
Destructor of Piezo Buzzer.
Definition at line 44 of file piezo_bz.cpp.
Member Function Documentation
| void change_frequency | ( | uint32_t | freq ) |
Change buzzer frequency.
- Parameters:
-
Buzzer frequency [Hz]
Definition at line 60 of file piezo_bz.cpp.
| void change_on_off | ( | uint32_t | on_off_time ) |
Change On-Off duration.
- Parameters:
-
Duration for ringing time and rest time (duty 50%) [mS]
Definition at line 72 of file piezo_bz.cpp.
| void start | ( | void | ) |
Start Buzzer.
Definition at line 50 of file piezo_bz.cpp.
| void stop | ( | void | ) |
Stop Buzzer.
Definition at line 55 of file piezo_bz.cpp.
Generated on Thu Aug 25 2022 13:50:55 by
1.7.2