controlling(Turning on and off) led through ext switch through interrupts - buggy

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sivaieee
Date:
Mon Nov 14 21:03:07 2016 +0000
Commit message:
EXT SWITCH WITH INTERRUPTS A LIL BUGGY

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 d839aded6393 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 14 21:03:07 2016 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalOut vrefh(D8);
+DigitalIn mySw(D11);
+Serial pc(USBTX, USBRX);
+InterruptIn event(D11);
+
+void trigger_rise(){
+    pc.printf("rise\n");
+    myled = 0;
+    }
+void trigger_fall(){
+    pc.printf("fall\n");
+    myled=1;
+    }
+    
+int main() {
+    vrefh = 0;
+     event.rise(&trigger_rise);
+     event.fall(&trigger_fall);
+     while(1){
+         //pc.printf("waiting\n");
+         
+    }
+}
diff -r 000000000000 -r d839aded6393 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Nov 14 21:03:07 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file