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

Hardware

source:/Beeper/doc/BeeperInterface.png source:/Beeper/doc/BeeperProduct.jpg
  • Available from all good electronics stores

Hello World!

source:/Beeper/doc/BeeperSchematic.png source:/Beeper/doc/BeeperPhoto.jpg
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

BeeperA class witch uses pwm to controle a beeper to generate sounds.
Functions
BeeperCreates a new beeper object.
beepBeep with given frequency and duration.
notePlays a midi note for a given time.
class Beeper
A class witch uses pwm to controle a beeper to generate sounds.
Beeper (PinName pin)
Creates a new beeper object.
void beep (float frequency,
float time)
Beep with given frequency and duration.
void note ( int,
float time)
Plays a midi note for a given time.

Resources

Datasheets

PCB Library and Footprint

The Eagle PCB repsitory can be found at the Eagle page.

The Library for the Beeper is