PEDRO MATIZ
/
DECO_7SEG_BCD
//CODIGO PARA PASAR DE BCD A 7 SEGMENTOS
Embed:
(wiki syntax)
Show/hide line numbers
dec_bcd_7seg.cpp
00001 #include "BCDSEG.h" // SE LLAMA LA LIBRERIA BCDSEG 00002 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 00003 int anodo::entrada(PinName a,PinName b,PinName c,PinName d) 00004 { 00005 BusIn dip(a,b,c,d); 00006 dipSw=dip.read(); 00007 return dipSw; 00008 } 00009 void anodo::visual(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g)// 00010 { 00011 _a=a;_b=b;_c=c;_d=d;_e=e;_f=f;_g=g; 00012 00013 } 00014 void anodo::bcd(int number) 00015 { 00016 BusOut display(_g,_f,_e,_d,_c,_b,_a); 00017 display=anod[number]; 00018 }
Generated on Tue Jul 19 2022 03:59:00 by 1.7.2