Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
play_buzzer.h@0:e44696c93c6b, 2019-01-10 (annotated)
- Committer:
- math991e
- Date:
- Thu Jan 10 07:33:55 2019 +0000
- Revision:
- 0:e44696c93c6b
- Child:
- 1:50204a498764
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| math991e | 0:e44696c93c6b | 1 | #ifndef MBED_BEEP_H |
| math991e | 0:e44696c93c6b | 2 | #define MBED_BEEP_H |
| math991e | 0:e44696c93c6b | 3 | |
| math991e | 0:e44696c93c6b | 4 | #include "mbed.h" |
| math991e | 0:e44696c93c6b | 5 | |
| math991e | 0:e44696c93c6b | 6 | namespace mbed { |
| math991e | 0:e44696c93c6b | 7 | |
| math991e | 0:e44696c93c6b | 8 | class play_buzzer { |
| math991e | 0:e44696c93c6b | 9 | |
| math991e | 0:e44696c93c6b | 10 | private : |
| math991e | 0:e44696c93c6b | 11 | PinName _pin; |
| math991e | 0:e44696c93c6b | 12 | PwmOut _pwm; |
| math991e | 0:e44696c93c6b | 13 | Timeout toff; |
| math991e | 0:e44696c93c6b | 14 | public: |
| math991e | 0:e44696c93c6b | 15 | play_buzzer(PinName); |
| math991e | 0:e44696c93c6b | 16 | void beep (float frequency, int time); |
| math991e | 0:e44696c93c6b | 17 | void nobeep(); |
| math991e | 0:e44696c93c6b | 18 | void Play_tunes(int notes, int tones); |
| math991e | 0:e44696c93c6b | 19 | int play(); |
| math991e | 0:e44696c93c6b | 20 | void setPin(PinName pin); |
| math991e | 0:e44696c93c6b | 21 | PinName getPin(); |
| math991e | 0:e44696c93c6b | 22 | }; |
| math991e | 0:e44696c93c6b | 23 | }; |
| math991e | 0:e44696c93c6b | 24 | #endif |
| math991e | 0:e44696c93c6b | 25 | |
| math991e | 0:e44696c93c6b | 26 |