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 Austin Blackstone

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut buzzer(D8);
00004 
00005 int main() {
00006     int on = 1, off = 0;
00007     
00008     while(1){
00009         buzzer = on;
00010         wait(.5);
00011         buzzer = off;
00012         wait(.5);
00013     }
00014 }