koo

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jon07
Date:
Thu Nov 09 13:46:10 2017 +0000
Commit message:
oll

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 404be732b8e8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 09 13:46:10 2017 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+
+Timer cont1;
+Timer cont2;
+Timer cont3;
+DigitalOut Led1(PB_3); // Led1 conectado al pin D3
+DigitalOut Led2(PB_5); // Led2 conectado al pin D4
+DigitalOut Led3(PB_4); // Led3 conectado al pin D5
+
+int main()
+{
+    cont1.start();
+    cont2.start();
+    cont3.start();
+
+    while(1) {
+        if (cont1.read () == 1) { //límite del contador 1 en 1 segundo
+            cont1.reset();
+            Led1 = !Led1;
+        }
+        if (cont2.read () == 1.2) { //límite del contador 2 en 1,2 segundos
+            cont2.reset();
+            Led2 = !Led2;
+        }
+        if (cont3.read () == 1.5) { //límite del contador 3 en 1,5 segundos
+            cont3.reset();
+            Led3 = !Led3;
+        }
+        //wait(0.1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 404be732b8e8 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 09 13:46:10 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file