Grove Button board example

Dependencies:   mbed

Fork of Seeed_Grove_Button_Example 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 DigitalIn button(D6);
00004 
00005 int main()
00006 {
00007     while(1){
00008         if(button){
00009             printf("Button Pressed\n\r");
00010             wait(0.7); // simple debouncing
00011         }           
00012     }
00013 
00014 }