i write a codding to make a volt meter...
i use LM35
and want to disply at LCD
Code: Select all
char *text = "testing...";
float blinkc ;
char txt[18];
float temp;
void main()
{
ADCON1 = 0x80; //
TRISA = 0b111111; //
Lcd_Init(&PORTC); // Initialize LCD connected to PORTB
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
Lcd_Out(1, 1, text); // Print text to LCD, 2nd row, 1st column
while(1)
{
temp = ADC_Read(0);
blinkc = (5*temp)/10.24;
FloatToStr(blinkc, txt);
Lcd_Out(2,1,txt);
Lcd_Out(2,10,"degree");
}
}//~!
lcd display by follow my calc and floatto str is
30.00000
how to show at LCD just 30.00 ?
please help me...
thanks