Franjo Tudek

Dependencies:   mbed SeeedShieldBot BluetoothSerial

https://os.mbed.com/media/uploads/franjo1/shema.png

Doorbell.cpp

Committer:
franjo1
Date:
2021-05-07
Revision:
0:90b835ec611a

File content as of revision 0:90b835ec611a:

#include "Doorbell.h"
#include "mbed.h"
Bell::Bell(PinName Piezzo) : Buzzer(Piezzo) {
    
}

void Bell::Buzz(int f, int b) {
    
    Buzzer.period(1/(f)); // set PWM period
    Buzzer=0.5; // set duty cycle
    wait(0.5*b);
}