test publish
Dependencies: mbed GroveEarbudSensor
Diff: Speaker.h
- Revision:
- 4:23aba111f73a
- Parent:
- 3:b4f04b8b8797
- Child:
- 5:ee265ab0752d
--- a/Speaker.h Thu Mar 24 16:35:09 2016 +0000 +++ b/Speaker.h Fri Mar 25 09:34:21 2016 +0000 @@ -0,0 +1,22 @@ +#ifndef _SPEAKER_H_ +#define _SPEAKER_H_ + +#include "mbed.h" +#include "Notes.h" + +/** +This class is used to generate music note through a speaker by sending a pwm signal +*/ +class Speaker { + private : + PwmOut* pin; + float pulseWidth; + protected : + public : + Speaker(PwmOut argPin); + bool setPulseWidth(float argPulseWidth); + void play(Notes note); + void mute(); +} + +#endif \ No newline at end of file