Mike EI2I / Mbed 2 deprecated BouttonD3Interrupt

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Kemix
Date:
Wed Mar 11 09:04:44 2015 +0000
Parent:
0:d26e8921753c
Commit message:
en mode mieux

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r d26e8921753c -r 034543cd3064 main.cpp
--- a/main.cpp	Wed Mar 11 08:38:23 2015 +0000
+++ b/main.cpp	Wed Mar 11 09:04:44 2015 +0000
@@ -8,14 +8,16 @@
 
 int main(void){
     DigitalOut led(LED1);
-    led = 1;
     InterruptIn btn(D3);
+    led = 0;
     
     btn.rise(truc);
     while(1){
         if(flag != 0){
                 led = !led;
                 wait(0.15);
+        }else{
+            led = 0;   
         }
     }
 }
\ No newline at end of file