ISISA-Zacatenco / Mbed 2 deprecated Cuentanumerica

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Javierdf
Date:
Sun Sep 22 03:09:20 2019 +0000
Commit message:
cuenta numerica

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 c323c4aeac85 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Sep 22 03:09:20 2019 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+ 
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalIn pulsador_1(PTA12);
+DigitalIn pulsador_2(PTC2);
+
+//Orden Segmentos: p,g,f,e;d,c,b,a
+BusOut pines_disp7S(PTA17, PTB9, PTA7,PTA6,PTA14,PTA16,PTA15,PTC16);
+int contador;
+int cod_disp7s[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};    
+
+
+int main() {
+    led2 = 1;
+    led1 = 1;
+contador=0;
+    while(1) {
+        
+        if(pulsador_1.read()==1){
+            led1 = !led1;
+            contador++;
+            wait(0.2);
+        }
+        
+        if(pulsador_2.read()==1){
+            led1 = !led1;
+            contador--;
+            wait(0.2);
+        }
+        
+        if(contador<0)
+            contador=9;
+            
+        if(contador>9)
+            contador=0;
+            
+        pines_disp7S=cod_disp7s[contador];
+        wait(0.2);
+        
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r c323c4aeac85 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Sep 22 03:09:20 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file