Práctica 2 Ejercicio 5

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
anderibabe
Date:
Fri Nov 03 14:23:34 2017 +0000
Commit message:
Pr?ctica 2 Ejercicio 5

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 65488f8d255b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 03 14:23:34 2017 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+Ticker Sw1; // Switch1 para cambiar el estado de los led
+
+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
+
+void recur ()
+{
+    Led1=!Led1;
+    Led2=!Led2;
+    Led3=!Led3;
+}
+
+
+
+int main()
+{
+Sw1.attach(&recur, 1);
+    while(1) {
+        sleep ();
+    }
+}
diff -r 000000000000 -r 65488f8d255b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 03 14:23:34 2017 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file