sacban
Junior Member level 3
Hello Everyone,
I made a project for a volt meter, this project already working fine, just I want to change the method during first time running.
First time running, I got digit 00.00 onto LCD appears, then once the voltage read source voltage "example 4,5 volt" the digit reading for 04.50, this is true, how can I change that way, when first time running the digit never show digit 00.00, then once have voltage 4.5 volt the digit will show 4.50.
Below are the code :
I hope someone there will help me solve this out.
Thank you.
I made a project for a volt meter, this project already working fine, just I want to change the method during first time running.
First time running, I got digit 00.00 onto LCD appears, then once the voltage read source voltage "example 4,5 volt" the digit reading for 04.50, this is true, how can I change that way, when first time running the digit never show digit 00.00, then once have voltage 4.5 volt the digit will show 4.50.
Below are the code :
Code:
void main()
{
ADCON1=0x82;
TRISA=0XFF;
Lcd_Init();
lcd_cmd(_LCD_CLEAR);
lcd_cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,5," Meter");
lcd_out(2,1,"VOLT:");
for(;;){
adc_value=ADC_Read(0);
adc_value=adc_value*5000/1023;
hit1=adc_value/1000;
hit2=(adc_value%1000)/100;
hit3=((adc_Value%1000)%100)/10;
hit4=((adc_value%1000)%100)%10;
lcd_chr(2,11,48+hitung1);
lcd_chr_cp(hitung2+48);
lcd_chr_cp('.');
lcd_chr_cp(48+hitung3);
lcd_chr_cp(48+hitung4);
lcd_chr_cp('V');
delay_ms(20);
}
}
I hope someone there will help me solve this out.
Thank you.