Go Down

Topic: DHT11 coding (Read 483 times) previous topic - next topic


I'm connecting my DHT11 with Arduino and LCD but I want the temperature to be in Fahrenheit, it's in Celsius as of now, does anyone who's good at coding mind adding it in my code below?


Nov 29, 2014, 06:31 am Last Edit: Nov 29, 2014, 05:24 pm by TobyTobyo
I can't seem to open your code, but this is what I did for mine:

Code: [Select]
Serial.print("Room Humidity: ");
 Serial.print("Room Temperature (C): ");
 //Fahrenheit conversion
 Fahrenheit = (DHT.temperature * 9.0) / 5.0 + 32;
 Serial.print("Room Temperature in (F): ");

This might be a little bit more than you need, but you need to essentially create a variable for Fahrenheit, then have that variable = (DHT.temperature)*1.8 + 32.

Hope this helps with your project


Go Up