how do i display decimal point on the resulting temperature with my Lm35 temperature circuit? Im using Pic18F452 microcontroller my code is below thanks alot
unsigned temp_value;
char out[6];
void main() {
ADCON1 = 0x80;
TRISA = 0xFF; // PORTA as input
TRISB = 0x00; // PORTB as ouput
Lcd_Init(&PORTB);
Lcd_Cmd(LCD_CLEAR);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Out(1,1,"Temperature is:");
do {
temp_value = (Adc_Read(0)/2); // Read analog input
WordToStr(temp_value,out);
Lcd_Out(2,10,out);
Lcd_Chr_Cp(223);
Lcd_Chr_Cp('C');
delay_ms(2500); // Sample at 2.5 sec
} while(1);
}