Conversor de BCD a siete segmentos

Dependents:   Nucleo_blink_led voltimetrofuncional

DECO.cpp

Committer:
briandk
Date:
3 months ago
Revision:
1:ad0edab33530
Parent:
0:3d7ebc7de009

File content as of revision 1:ad0edab33530:




# include "DECO.h"

int SEG[16]= {0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x58,0x00,0x18,0x08,0x03,0x0b,0x23,0x4f,0x20};

/*int anodo::entrada(PinName a,PinName b, PinName c,PinName d)
    {
    BusIn dip(a,b,c,d);
    dipp= dip.read();
    return dipp;
    }*/
    
    
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:: Disp(int number)
    {
    BusOut display (_g,_f,_e,_d,_c,_b,_a);
    display=SEG[number];

    }
    
    
void anodo::ConfEn(PinName one, PinName two,int uni,int dec,int time)
    {
  DigitalOut Edec(one);
  DigitalOut Euni(two);

    for(int u=0; u<time; u++)
        {
        Edec=1;
        Euni=0;
        Disp(uni);
        wait(0.005);
        
        Edec=0;
        Euni=1;
        Disp(dec);
        wait(0.005);
        }
    }