Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
Beep Class Reference
Generates a tone with a buzzer, based on a PwmOut The class use a timeout to switch off the sound - it is not blocking while making noise. More...
#include <Beep.h>
Public Member Functions | |
Beep (PinName pin) | |
Create a Beep object connected to the specified PwmOut pin. | |
void | beep (float frequency, float time) |
Beep with given frequency and duration. | |
void | nobeep () |
stop the beep instantaneously. |
Detailed Description
Generates a tone with a buzzer, based on a PwmOut The class use a timeout to switch off the sound - it is not blocking while making noise.
Example:
// Beep at 2kHz for 0.5 seconds #include "mbed.h" #include "Beep.h" Beep buzzer(p21); int main() { ... buzzer.beep(2000,0.5); ... }
Definition at line 24 of file Beep.h.
Constructor & Destructor Documentation
Beep | ( | PinName | pin ) |
Member Function Documentation
void beep | ( | float | freq, |
float | time | ||
) |
Generated on Tue Jul 12 2022 14:09:28 by 1.7.2