Pushbutton demo using internal pullup feature
Revision 0:0cc4122581e7, committed 2011-09-20
- 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 |
--- /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;
+ }
+}
--- /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