float vout;
unsigned int adc_value;
unsigned int value;
void value_converter(unsigned int adc_value)
{ unsigned char temp[8];
vout = (float) adc_value * 0.488;
value = (unsigned int) vout; // only decimal part
temp[0] = value/100+48; //Add 48 to get the ASCII character
temp[1]='.' ;
temp[2] = ( value/10)%10+48;
temp[3] = value % 10 +48;
LCD_Write_Text(1,1,temp) ;
}
//the test
LCD_CLS();
for (i=0;i<1023;i=i+16)
{
value_converter(i);
Delay_ms(500);
}
while(1);