Hi all.
I'm triying to make a [forget my complex project] where I measure internal (dht11) and external (dht22) humidity and temperature.
I managed to do it with this code, but It won't work I delete a "Serial.println" (this doesn't make sense to me) i commented it in the code:
#include <dht11.h>
#include <DHT22.h>
//decrlaring dht22, name, pin
DHT22 humext (2);
//name of the dht11
dht11 humint;
void setup()
{
//setting the pin for dht11
humint.attach(3);
Serial.begin(9600);
Serial.println("DHTxx TEST PROGRAM ");
}
void loop()
{
delay(2000);
Serial.print("Humidity (%): ");
Serial.println((float)humint.humidity, DEC);
Serial.print("Temperature (°C): ");
Serial.println((float)humint.temperature, DEC);
//IF WE ERASE FROM HERE ->
Serial.print("Temperature (°F): ");
Serial.println(humint.fahrenheit(), DEC);
//<<-- TO HERE, it won't work
Serial.println("Temp & % EXTerior");
humext.readData();
Serial.print(humext.getTemperatureC());
Serial.print(" C ");
Serial.print(humext.getHumidity());
Serial.println("%");
}
If I deleted the part between //, dht11 gives me " 0" readings. I don't want fahrenheit values in my project, just celsius
I just can't understand it.
Im using Arduino 1.0 and the following libraries:
dht11
https://www.virtuabotix.com/feed/wp-content/uploads/2011/11/DHT11_2S0A.zip
dht22
http://nethoncho.com/arduino/DHT22/DHT22-04.zip
Thank you very much