//CODIGO PARA PASAR DE BCD A 7 SEGMENTOS

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ABD931
Date:
Sat Aug 12 21:31:02 2017 +0000
Commit message:
//CODIGO PARA PASAR DE BCD A 7 SEGMENTOS

Changed in this revision

dec_bcd_7seg.cpp Show annotated file Show diff for this revision Revisions of this file
dec_bcd_7seg.h Show annotated file Show diff for this revision Revisions of this file
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 d343b54f75c1 dec_bcd_7seg.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dec_bcd_7seg.cpp	Sat Aug 12 21:31:02 2017 +0000
@@ -0,0 +1,18 @@
+#include "BCDSEG.h"  // SE LLAMA LA LIBRERIA BCDSEG
+int anod[12]= {0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x58,0x00,0x18,0x08,0x03}; // SE CREA VECTOR DE 12 POSICIONES PARA VISUALIZAR LOS VALORES EN EL DIPSLAY
+int anodo::entrada(PinName a,PinName b,PinName c,PinName d) 
+{
+    BusIn dip(a,b,c,d); 
+    dipSw=dip.read();
+    return dipSw;
+}
+void anodo::visual(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g)// 
+{
+    _a=a;_b=b;_c=c;_d=d;_e=e;_f=f;_g=g;
+    
+}
+void anodo::bcd(int number)
+{
+    BusOut display(_g,_f,_e,_d,_c,_b,_a);
+    display=anod[number];
+}
diff -r 000000000000 -r d343b54f75c1 dec_bcd_7seg.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dec_bcd_7seg.h	Sat Aug 12 21:31:02 2017 +0000
@@ -0,0 +1,17 @@
+#ifndef BCDSEG_h
+#define BCDSEG_h
+#include "mbed.h"
+
+class anodo  
+{
+    public:    int entrada(PinName a,PinName b,PinName c,PinName d);
+               void visual (PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g);
+               void bcd (int number);
+    
+    private:    PinName _a;PinName _b;PinName _c;PinName _d;PinName _e;PinName _f;PinName _g;
+                int dipSw;
+    
+};
+    
+    
+#endif
\ No newline at end of file
diff -r 000000000000 -r d343b54f75c1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 12 21:31:02 2017 +0000
@@ -0,0 +1,21 @@
+//CODIGO PARA PASAR DE BCD A 7 SEGMENTOS 
+//ANDRES FELIPE FONSECA FIQUE, RICARDO CERON, PEDRO MATIZ
+#include "BCDSEG.h"
+
+
+Serial pc(USBTX,USBRX);
+int numero;
+
+int main() {
+    
+      anodo LAB2;
+      LAB2.visual(D6,D7,D8,D9,D10,D11,D12);
+      while(1) {
+          numero= LAB2.entrada(D2,D3,D4,D5);
+          LAB2.bcd(numero);
+          wait(0.5);
+          
+        
+              
+    }
+}
diff -r 000000000000 -r d343b54f75c1 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 12 21:31:02 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fd96258d940d
\ No newline at end of file