Pruebas del pulsador funcionando / por alguna razon no funcionan D0/D1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
djinn77
Date:
Mon Oct 01 05:58:32 2018 +0000
Commit message:
Pruebas de pulsador funcionando

Changed in this revision

mbed.bld Show annotated file Show diff for this revision Revisions of this file
pulsardo_led.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 01 05:58:32 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pulsardo_led.cpp	Mon Oct 01 05:58:32 2018 +0000
@@ -0,0 +1,23 @@
+
+#include "mbed.h"
+
+DigitalOut led1(D2); // conector arduino
+DigitalOut led2(D3); // conector arduino
+DigitalIn pulsador1(A5); //pulsador conector Arduino
+DigitalIn pulsador2(A4); //pulsador conector Arduino
+
+int main() {
+             
+    while(1) {
+        if(pulsador1 ==1){
+            led1= 1;
+            }else{
+                led1=0;
+                }
+        if(pulsador2 ==1){
+            led2= 1;
+            }else{
+                led2=0;
+                }        
+    }
+}