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

main.cpp

Committer:
mbedAustin
Date:
2014-09-04
Revision:
0:3da67ed4c5a4

File content as of revision 0:3da67ed4c5a4:

#include "mbed.h"

DigitalOut buzzer(D8);

int main() {
    int on = 1, off = 0;
    
    while(1){
        buzzer = on;
        wait(.5);
        buzzer = off;
        wait(.5);
    }
}