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.
Fork of beep by
Revision 5:e4cbc1efcbe4, committed 2012-11-09
- Comitter:
- wsjoukes
- Date:
- Fri Nov 09 16:11:48 2012 +0000
- Parent:
- 3:5a8242af60ba
- Commit message:
- Commit message
Changed in this revision
beep.c | Show annotated file Show diff for this revision Revisions of this file |
beep.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/beep.c Wed Feb 02 22:38:30 2011 +0000 +++ b/beep.c Fri Nov 09 16:11:48 2012 +0000 @@ -44,9 +44,11 @@ * @param time - the duration of the tone in seconds */ -void Beep::beep(float freq, float time) { +void Beep::beepFreq(float freq){ _pwm.period(1.0/freq); +} +void Beep::beepTime(float time) { _pwm.write(0.5); // 50% duty cycle - beep on toff.attach(this,&Beep::nobeep, time); // time to off }
--- a/beep.h Wed Feb 02 22:38:30 2011 +0000 +++ b/beep.h Fri Nov 09 16:11:48 2012 +0000 @@ -43,7 +43,8 @@ * @param frequency - the frequency of the tone in Hz * @param time - the duration of the tone in seconds */ - void beep (float frequency, float time); + void beepFreq (float frequency); + void beepTime (float time); /** stop the beep instantaneous * usually not used