miniblip button example

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
pighixxx
Date:
Thu Nov 26 09:26:11 2015 +0000
Commit message:
miniblip button example

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 26 09:26:11 2015 +0000
@@ -0,0 +1,23 @@
+// miniblip onboard buttons
+
+// main button:         P0_23
+// progr button:        P0_1
+// vibration/tilt:      P1_15
+// external buttons:    P0_15, P0_14, P0_13, P0_12, P0_11
+// encoder:             P0_20, P0_2
+// encoder button:      P1_19
+// ext (top/left):      P0_21 
+
+#include "mbed.h"
+ 
+DigitalIn pushbutton(P0_23); //Define pushbutton
+Serial pc(USBTX, USBRX); // Define serial TX RX
+ 
+int main() {
+    while(1) {
+    if (pushbutton) {
+        pc.printf("Hello World");
+        wait(1);  // Waits 1 second and print Hello World again    
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 26 09:26:11 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad
\ No newline at end of file