Marcos Postemsky / Mbed 2 deprecated frdm_interrupciones

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
marcospostemsky
Date:
Mon Oct 14 00:22:59 2019 +0000
Commit message:
Code-complete;

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 14 00:22:59 2019 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+/*En este codigo se atacha la interrupcion de botón sw2 con la funcón sw2_presionado*/
+
+DigitalOut led_red(LED_RED);
+InterruptIn sw3(SW3);
+Serial pc(USBTX, USBRX);
+
+
+void sw3_presionado(void)
+{
+    led_red = !led_red;
+    pc.printf("El boton SW3 fue presionado.\n");
+}
+
+int main()
+{   
+    //Comunicación Serial
+    pc.baud(115200);
+    pc.printf("Inicia la comunicacion serial con FRDM.\n");
+    //Atacha la interrupcion de sw2 a la función declarada
+    sw3.rise(&sw3_presionado);
+    while (true) {
+        //Este loop permite que el programa siga ejecutandose.
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 14 00:22:59 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file