Go Down

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

fandiaye

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?

TobyTobyo

#1
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.println(DHT.humidity);
 Serial.print("Room Temperature (C): ");
 Serial.println(DHT.temperature);
 
 //Fahrenheit conversion
 Fahrenheit = (DHT.temperature * 9.0) / 5.0 + 32;
 Serial.print("Room Temperature in (F): ");
 Serial.println(Fahrenheit);


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

Luke

Go Up