Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Servo ros_lib_kinetic
Diff: Buzzer/Buzzer.cpp
- Revision:
- 6:2cc2aac35868
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Buzzer/Buzzer.cpp Tue Nov 12 12:56:02 2019 +0000
@@ -0,0 +1,42 @@
+#include "Buzzer.h"
+
+cBuzzer::cBuzzer(DigitalOut Buzz): _Buzz(Buzz)
+{
+ _Buzz = 0;
+
+}
+
+/*--------------------------------------------------------------------------------
+Function name: short_buzz()
+Input Parameters: N/A
+Output Parameters: N/A
+Description: Turns the buzzer on for a short period of time
+----------------------------------------------------------------------------------*/
+void cBuzzer::Beep()
+{
+ _Buzz =1;
+ wait (0.5);
+ _Buzz =0;
+
+}
+/*--------------------------------------------------------------------------------
+Function name: buzzer_on()
+Input Parameters: N/A
+Output Parameters: N/A
+Description: Turns the buzzer on indefinitely
+----------------------------------------------------------------------------------*/
+void cBuzzer::buzzer_on()
+{
+ _Buzz = 1; //Enable Buzzer
+}
+
+/*--------------------------------------------------------------------------------
+Function name: buzz_off()
+Input Parameters: N/A
+Output Parameters: N/A
+Description: Turns buzzer off indefinitely
+----------------------------------------------------------------------------------*/
+void cBuzzer::buzz_off()
+{
+ _Buzz = 0; //Disable Buzzer
+}
\ No newline at end of file