Beeper
A low cost piezo transducer used to make tones.
Library
Import Library:
http://mbed.org/projects/cookbook/svn/Beeper/trunk
Import Example program:
http://mbed.org/projects/cookbook/svn/Beeper/example
- For details on how to use this in the compiler, see Importing Projects and Libraries in to the Compiler
Hardware
|
|
- Available from all good electronics stores
Hello World!
|
|
| Schematic | Photo |
#include "mbed.h" #include "Beeper.h" Beeper myBeeper(p21); int main(){ for (int i = 0; i < 128 ; i++){ myBeeper.note(i,0.1);} } |
| Source Code of Beeper.bin(LPC1768 LPC2368) |
API
| Beeper | A class witch uses pwm to controle a beeper to generate sounds. |
| Functions | |
| Beeper | Creates a new beeper object. |
| beep | Beep with given frequency and duration. |
| note | Plays a midi note for a given time. |
A class witch uses pwm to controle a beeper to generate sounds.
class Beeper
Creates a new beeper object.
Beeper ( PinName pin )
Beep with given frequency and duration.
void beep ( float frequency, float time )
Plays a midi note for a given time.
void note ( int, float time )
- Full api at http://mbed.org/projects/cookbook/api/Beeper/trunk
- Full source at http://mbed.org/projects/cookbook/svn/Beeper/trunk
Resources
Datasheets
PCB Library and Footprint
The Eagle PCB repsitory can be found at the Eagle page.
The Library for the Beeper is
