test publish
Dependencies: mbed GroveEarbudSensor
Speaker.h@4:23aba111f73a, 2016-03-25 (annotated)
- Committer:
- age2pierre
- Date:
- Fri Mar 25 09:34:21 2016 +0000
- Revision:
- 4:23aba111f73a
- Parent:
- 3:b4f04b8b8797
- Child:
- 5:ee265ab0752d
Added Notes enum class and Speaker class
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 | 4:23aba111f73a | 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 | 4:23aba111f73a | 20 | } |
age2pierre | 4:23aba111f73a | 21 | |
age2pierre | 4:23aba111f73a | 22 | #endif |