button trigger interrupt

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ittraining
Date:
Thu May 05 03:36:22 2016 +0000
Parent:
0:912303e63cbd
Commit message:
button interrupt;

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
--- a/main.cpp	Fri Feb 21 12:53:03 2014 +0000
+++ b/main.cpp	Thu May 05 03:36:22 2016 +0000
@@ -5,17 +5,20 @@
  
 float delay = 1.0; // 1 sec
  
-void pressed()
+void pressed_down()
 {
     if (delay == 1.0)
         delay = 0.2; // 200 ms
     else
         delay = 1.0; // 1 sec
 }
+
+
  
 int main()
 {
-    mybutton.fall(&pressed);
+   // mybutton.fall(&pressed_down);
+    mybutton.rise(&pressed_down);
     while (1) {
         myled = !myled;
         wait(delay);
--- a/mbed.bld	Fri Feb 21 12:53:03 2014 +0000
+++ b/mbed.bld	Thu May 05 03:36:22 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/aae6fcc7d9bb
\ No newline at end of file