aca igualmente

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dex2271
Date:
Thu Aug 12 15:05:39 2021 +0000
Commit message:
pone cualquier cosa

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	Thu Aug 12 15:05:39 2021 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#define tiempo                  500
+BusOut seg (D3,D4,D14,D6,D7,D8,D10);//abcdefg
+char hex[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,};
+int a=0;
+int b=0;
+static int contador;
+DigitalIn Boton(PA_0);
+DigitalIn Boton2(D1);
+DigitalOut led(D15);
+DigitalOut led2(D13);
+int main()
+{
+
+ 
+ while (1){
+                 
+                     while(!Boton2 and !Boton and a<=b){
+                     seg=hex[contador];
+                     led=0;
+                    contador=contador+1;
+                    thread_sleep_for(500);
+                    if(Boton){
+                          a=contador;
+                          b=contador;
+                          }
+                          if(Boton2)
+                      {
+                          b=contador;
+                          }
+                    if(a<b){
+                        led=1;
+                        }
+                        
+                    
+                      if(contador==10)
+                      {
+                        contador=0;       
+                        }    
+                        }
+                        
+                      if (a>b)(led2=!led);
+                          
+                        }  
+                 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 12 15:05:39 2021 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557
\ No newline at end of file