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
Buzzer.cpp
00001 #include "Buzzer.h" 00002 00003 cBuzzer::cBuzzer(DigitalOut Buzz): _Buzz(Buzz) 00004 { 00005 _Buzz = 0; 00006 00007 } 00008 00009 /*-------------------------------------------------------------------------------- 00010 Function name: short_buzz() 00011 Input Parameters: N/A 00012 Output Parameters: N/A 00013 Description: Turns the buzzer on for a short period of time 00014 ----------------------------------------------------------------------------------*/ 00015 void cBuzzer::Beep() 00016 { 00017 _Buzz =1; 00018 wait (0.5); 00019 _Buzz =0; 00020 00021 } 00022 /*-------------------------------------------------------------------------------- 00023 Function name: buzzer_on() 00024 Input Parameters: N/A 00025 Output Parameters: N/A 00026 Description: Turns the buzzer on indefinitely 00027 ----------------------------------------------------------------------------------*/ 00028 void cBuzzer::buzzer_on() 00029 { 00030 _Buzz = 1; //Enable Buzzer 00031 } 00032 00033 /*-------------------------------------------------------------------------------- 00034 Function name: buzz_off() 00035 Input Parameters: N/A 00036 Output Parameters: N/A 00037 Description: Turns buzzer off indefinitely 00038 ----------------------------------------------------------------------------------*/ 00039 void cBuzzer::buzz_off() 00040 { 00041 _Buzz = 0; //Disable Buzzer 00042 }
Generated on Wed Jul 13 2022 08:03:54 by
1.7.2