Franjo Tudek

Dependencies:   mbed SeeedShieldBot BluetoothSerial

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Doorbell.cpp Source File

Doorbell.cpp

00001 #include "Doorbell.h"
00002 #include "mbed.h"
00003 Bell::Bell(PinName Piezzo) : Buzzer(Piezzo) {
00004     
00005 }
00006 
00007 void Bell::Buzz(int f, int b) {
00008     
00009     Buzzer.period(1/(f)); // set PWM period
00010     Buzzer=0.5; // set duty cycle
00011     wait(0.5*b);
00012 }