//conversor de bcd a 7 segmentos

Dependencies:   mbed

main.cpp

Committer:
cristiany
Date:
2017-08-19
Revision:
1:c773d22f95b3
Parent:
0:da3425777443

File content as of revision 1:c773d22f95b3:

//ADC Conversor with Leds' Ruler

//Cristian Yomayuza
//Anderson Murte
//Arley Rueda

#include "seg.h"
 
AnalogIn analog_value(A0);
float Vvolt[13]={0,0.275,0.55,0.825,1.1,1.3,1.6,1.9,2.2,2.4,2.7,3,3.3};
float Lectura;
int Local;
int main()
 {
    cod obj;
    obj.salida(D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13);
    while(1) 
    {
        Lectura=analog_value.read_u16()*0.00005;
        
        
        for(int i=0;i<14;i++)
        {
            if(Lectura<=Vvolt[i])
            {
                Local=i;
               break;
            }
            
            
        }
         obj.leds(Local);
                wait(0.9);
        
              
        
        
    }
}