piezodriver 2.1.0.0
|
Piezo Driver Click is a compact add-on board that allows you easy system configuration for driving a two-terminal or three-terminal piezo sounder with few external components. This board features the PAM8906, a piezo sounder driver with self-excitation mode from Diodes Incorporated.
We provide a library for the Piezo Driver Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for Piezo Driver Click driver.
piezodriver_cfg_setup
Config Object Initialization function. piezodriver_init
Initialization function. piezodriver_default_cfg
Click Default Configuration function. piezodriver_pwm_stop
Piezo Driver stop PWM module. piezodriver_pwm_start
Piezo Driver start PWM module. piezodriver_play_sound
Piezo Driver play sound function. This example demonstrates the use of Piezo Driver Click board.
The demo application is composed of two sections :
Initializes the driver and logger.
Plays the Imperial March melody. Also logs an appropriate message on the USB UART.
The minimal PWM Clock frequency required for this example is the frequency of tone C6 - 1047 Hz. In order to run this example and play all tones correctly, the user will need to decrease the MCU's main clock frequency in MCU Settings for certain architectures in order to get the required PWM clock frequency.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.