![](/media/cache/group/Logo-slogen.png.50x50_q85.png)
Seeed Grove Buzzer example. The buzzer buzzes on for .5 second and then off for .5 second.
Dependencies: mbed
Fork of Seeed_Grove_Buzzer by
Revision 0:3da67ed4c5a4, committed 2014-09-04
- Comitter:
- mbedAustin
- Date:
- Thu Sep 04 02:41:17 2014 +0000
- Commit message:
- Buzzer works. PWM Period = 1s, duty cycle = .5s
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 3da67ed4c5a4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 04 02:41:17 2014 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" + +DigitalOut buzzer(D8); + +int main() { + int on = 1, off = 0; + + while(1){ + buzzer = on; + wait(.5); + buzzer = off; + wait(.5); + } +}
diff -r 000000000000 -r 3da67ed4c5a4 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 04 02:41:17 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file