jednostavni buzzer
Dependents: konstrukcijski_zadatak
buzzer.h
- Committer:
- pkresic
- Date:
- 2021-11-30
- Revision:
- 0:9f85ba530763
File content as of revision 0:9f85ba530763:
#ifndef MBED_BEEP_H #define MBED_BEEP_H #include "mbed.h" namespace mbed { /* Class: Beep * A class which uses pwm to controle a beeper to generate sounds. */ class Beep { public: Beep (PinName pin);//Specified PwmOut pin for buzzer /** Beep with given frequency and duration. * * @param frequency - the frequency of the tone in Hz * @param time - the duration of the tone in seconds */ void beep (float frequency, float time); void nobeep(); private : PwmOut _pwm; Timeout toff; }; } #endif