Grove Button board example

Dependencies:   mbed

Fork of Seeed_Grove_Button_Example by Austin Blackstone

Files at this revision

API Documentation at this revision

Comitter:
mbedAustin
Date:
Thu Sep 04 03:04:40 2014 +0000
Commit message:
Seeed Grove button sensor example. Simple busy wait debouncing.

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 d0ac4e3a0b7a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 04 03:04:40 2014 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+
+DigitalIn button(D6);
+
+int main()
+{
+    while(1){
+        if(button){
+            printf("Button Pressed\n\r");
+            wait(0.7); // simple debouncing
+        }           
+    }
+
+}
diff -r 000000000000 -r d0ac4e3a0b7a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 04 03:04:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file