sensor

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
franni
Date:
Thu Nov 30 01:00:47 2017 +0000
Commit message:
CNY70

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 81b798962422 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 30 01:00:47 2017 +0000
@@ -0,0 +1,53 @@
+#include "mbed.h"
+
+InterruptIn s0(PTA13); // Pines de Interrupción según hoja técnica
+InterruptIn s1(PTD2);
+InterruptIn s2(PTA4);
+InterruptIn s3(PTA12);
+DigitalOut led_r(LED1);
+DigitalOut led_g(LED2);
+DigitalOut led_b(LED3);
+
+
+void ISR1()
+{
+    led_r= !led_r;
+    wait(1);
+}
+
+void ISR2()
+{
+    led_g = !led_g;
+    wait(1);
+}
+
+void ISR3()
+{
+    led_b= !led_b;
+    wait(1);
+}
+
+void ISR4()
+{
+    led_r = !led_r;
+    led_g = !led_g;
+    led_b = !led_b;
+    wait(1);
+}
+
+int main()
+{
+    s0.mode(PullUp);
+    s1.mode(PullUp);
+    s2.mode(PullUp);
+    s3.mode(PullUp);
+    s0.rise(&ISR1);
+    s1.rise(&ISR2);
+    s2.rise(&ISR3);
+    s3.rise(&ISR4);
+    while(1) {
+        wait(0.1);
+    }
+}
+
+
diff -r 000000000000 -r 81b798962422 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 30 01:00:47 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file