buzzer
Diff: Buzzer.h
- Revision:
- 0:c5a5dc015c10
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Buzzer.h Sun Dec 22 11:13:24 2019 +0000 @@ -0,0 +1,25 @@ +#ifndef BUZZER_H +#define BUZZER_H + +#include "mbed.h" + +class Buzzer +{ + public: + Buzzer(PinName pin); + Buzzer(PinName pin, float period); + ~Buzzer(); + void definirPeriode(float period); + void changerPeriode(float period); + void demarrer(); + void arreter(); + + private: + float _period; + DigitalOut* _buzzer; + Ticker _ticker; + + void bipper(); +}; + +#endif // BUZZER_H \ No newline at end of file