AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Buzzer.cpp Source File

Buzzer.cpp

00001 #include "Buzzer.h"
00002 #include "mbed.h"
00003 
00004 Buzzer::Buzzer(PinName buzzerPin) : out(buzzerPin){
00005     out = 0.0;    
00006 }
00007 
00008 void Buzzer::startupBeep(){
00009     
00010 }
00011 
00012 void Buzzer::playNote(float frequency, float duration, float volume){
00013         out.period(1.0/frequency);
00014         out = volume/2.0;
00015         wait_ms(duration);
00016         out = 0.0;    
00017 }