Lizzy project
Dependencies: aconno_I2C Lis2dh12 adc52832_common aconno_SEGGER_RTT
Diff: bsp/bsp_buzz.cpp
- Revision:
- 8:7ba4f82de9b6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bsp/bsp_buzz.cpp Tue Mar 20 15:13:51 2018 +0000 @@ -0,0 +1,20 @@ +#include "bsp_buzz.h" + + +void Buzz::enable() +{ + buzzer.enable(BUZZER_FREQUENCY_HZ); + buzzer.enableChannel(0, pwm_pin); + buzzer.setDuty(0,0.5f); + + state = true; +} + +void Buzz::disable() +{ + buzzer.enable(0); + buzzer.setDuty(0, 0); + buzzer.disable(); + + state = false; +}