Pushbutton demo using internal pullup feature

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
4180_1
Date:
Tue Sep 20 13:52:11 2011 +0000
Commit message:

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 0cc4122581e7 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 20 13:52:11 2011 +0000
@@ -0,0 +1,13 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalIn pb(p8);
+// SPST Pushbutton demo using internal PullUp function
+// no external PullUp resistor needed
+// Pushbutton from P8 to GND.
+int main() {
+    pb.mode(PullUp);
+    while(1) {
+        myled = pb;
+    }
+}
diff -r 000000000000 -r 0cc4122581e7 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 20 13:52:11 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912