test publish
Dependencies: mbed GroveEarbudSensor
Speaker.h@13:879d678baf64, 2016-04-14 (annotated)
- Committer:
- age2pierre
- Date:
- Thu Apr 14 14:01:28 2016 +0000
- Revision:
- 13:879d678baf64
- Parent:
- 5:ee265ab0752d
Added Ticker
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
age2pierre | 4:23aba111f73a | 1 | #ifndef _SPEAKER_H_ |
age2pierre | 4:23aba111f73a | 2 | #define _SPEAKER_H_ |
age2pierre | 4:23aba111f73a | 3 | |
age2pierre | 4:23aba111f73a | 4 | #include "mbed.h" |
age2pierre | 4:23aba111f73a | 5 | #include "Notes.h" |
age2pierre | 4:23aba111f73a | 6 | |
age2pierre | 4:23aba111f73a | 7 | /** |
age2pierre | 4:23aba111f73a | 8 | This class is used to generate music note through a speaker by sending a pwm signal |
age2pierre | 4:23aba111f73a | 9 | */ |
age2pierre | 4:23aba111f73a | 10 | class Speaker { |
age2pierre | 4:23aba111f73a | 11 | private : |
age2pierre | 4:23aba111f73a | 12 | PwmOut* pin; |
age2pierre | 4:23aba111f73a | 13 | float pulseWidth; |
age2pierre | 4:23aba111f73a | 14 | protected : |
age2pierre | 4:23aba111f73a | 15 | public : |
age2pierre | 5:ee265ab0752d | 16 | Speaker(PwmOut* argPin); |
age2pierre | 4:23aba111f73a | 17 | bool setPulseWidth(float argPulseWidth); |
age2pierre | 4:23aba111f73a | 18 | void play(Notes note); |
age2pierre | 4:23aba111f73a | 19 | void mute(); |
age2pierre | 5:ee265ab0752d | 20 | }; |
age2pierre | 4:23aba111f73a | 21 | |
age2pierre | 4:23aba111f73a | 22 | #endif |