Microcontroller › 8051 › Celsius to Fahrenheit › temp in fahrenheit only…..
November 26, 2010 at 6:51 pm
#5164
Anonymous
Guest
if u want temperature in fahrenheit only then u can make the following changes in c code of link provided by u…
go to convert function
> remove the code in red color
> compile and run the code.
void convert() // Function to convert the values of ADC into numeric value to be sent to LCD
{
int s;
lcd_cmd(0x81);
delay(2);
lcd_data_string("TEMP:");
test_final=(((9*test_intermediate3)/5)+32);
s=test_final/100;
test_final=test_final%100;
lcd_cmd(0x88);
if(s!=0)
lcd_data(s+48);
else
lcd_cmd(0x06);
s=test_final/10;
test_final=test_final%10;
lcd_data(s+48);
lcd_data(test_final+48);
lcd_data(0);
lcd_data('F');
lcd_data(' ');
test_final=test_intermediate3;
lcd_cmd(0xc1); //Setting cursor to first position of first line
delay(2);
lcd_data_string("TEMP:");
s=test_final/100;
test_final=test_final%100;
lcd_cmd(0xc8);
if(s!=0)
lcd_data(s+48);
else
lcd_cmd(0x06);
s=test_final/10;
test_final=test_final%10;
lcd_data(s+48);
lcd_data(test_final+48);
lcd_data(0);
lcd_data('c');
lcd_data(' ');
delay(2);
}
else elaborate u’r quarry……..