Simple tool for PWM piezo speaker
Revision 3:df1e38c2c57b, committed 2016-10-01
- Comitter:
- TeaPack_CZ
- Date:
- Sat Oct 01 21:24:26 2016 +0000
- Parent:
- 2:fa6d9a0b66fc
- Commit message:
- Add documentation for public functions.
Changed in this revision
Piezo.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Piezo.h Sat Oct 01 21:15:45 2016 +0000 +++ b/Piezo.h Sat Oct 01 21:24:26 2016 +0000 @@ -50,15 +50,24 @@ class Piezo { - public: + + /** Constructor, Pin must be PWM capable*/ Piezo(PinName Pwmout); - + + /** Blocking function for playing sound of given frequency and + * duration in ms + */ void play(float, int); + + /** Nonblocking function for playing sound of given frequency and + * duration in ms + */ void playAsync(float, int); - + + /** Function for stopping all sounds */ void stop(); - + private: PwmOut _pwm; Ticker _timer;