![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Code for the keypad
Dependencies: TextLCD keypad mbed-rtos mbed
Diff: buzzer/buzzer.cpp
- Revision:
- 0:f39f0de7c0ce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buzzer/buzzer.cpp Mon May 08 19:57:56 2017 +0000 @@ -0,0 +1,17 @@ +#include "buzzer.h" +#include "mbed.h" + +Buzzer::Buzzer(PinName buzzerPin) : out(buzzerPin){ + out = 0.0; +} + +void Buzzer::startupBeep(){ + +} + +void Buzzer::playNote(float frequency, float duration, float volume){ + out.period(1.0/frequency); + out = volume/2.0; + wait_ms(duration); + out = 0.0; +} \ No newline at end of file