solution interrupt program

Fork of digitalInInterrupt_sample by William Marsh

Files at this revision

API Documentation at this revision

Comitter:
cvmanuel
Date:
Fri Feb 02 18:21:27 2018 +0000
Parent:
4:5af35f086ddd
Commit message:
interrupts solution;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5af35f086ddd -r dd7d8fb1ad75 main.cpp
--- a/main.cpp	Thu Feb 01 17:13:53 2018 +0000
+++ b/main.cpp	Fri Feb 02 18:21:27 2018 +0000
@@ -17,8 +17,8 @@
 volatile int pressEvent = 0 ;
 volatile int pressEvent2 = 0 ;
 
-    bool pressed1 = false;
-    bool pressed2 = false;
+volatile bool pressed1 = false;
+volatile bool pressed2 = false;
 
 // This function is invoked when then interrupt occurs
 //   Signal that the button has been pressed
@@ -58,6 +58,6 @@
         if(!pressed2) {
             led2= !led2;
         }
-        Thread::wait(2000) ;
+        Thread::wait(500) ;
     }
 }
\ No newline at end of file