- This topic has 2 replies, 3 voices, and was last updated 13 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › Celsius to Fahrenheit
hi friends
how do i change the code use on this project. to display the temperature in fahrenheit
thank in advance.
http://www.engineersgarage.com/microcontroller/8051projects/digital-clock-with-digital-thermometer-AT89C51
F = (9/5)*C+32
f is temperature in fahrenheit and c is tempeature in degree celcius
this is the global formula….
very excatly you got struct.
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
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……..