Hey guys iI get this error everytimeevery time. I used the DHT tester file from the library : https://codeload.github.com/adafruit/DHT-sensor-library/zip/masterthis library wich gave. Which gives me thisan error.
And then I realized that in my code i realize that Arduino recognizerecognizes only the readTemperaturereadTemperature function, not the readHumidityreadHumidity, but it doesntdoesn't give any compile error. Also, when iI read the sensor, this is the output:
Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
My code is here:
//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5 // whatwhich digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
Serial.begin(9600);
delay(300);
lcd.begin(16,2);
Serial.println("Humidity Sensor Test");
dht.begin();
delay(300);
}
void loop() {
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
int h = dht.readHumidity();
int t = dht.readTemperature();
// set the cursor to (0,0):
lcd.setCursor(0, 0);
// print from 0 to 9:
lcd.print("Temp: ");
lcd.print(t);
lcd.print("C");
// set the cursor to (16,1):
lcd.setCursor(0,1);
lcd.print("Humidity: ");
lcd.print(h);
lcd.print("%");
Serial.print("Temp: ");
Serial.print(t);
Serial.print("C, Humidity: ");
Serial.print(h);
Serial.println("%");
delay(2500);
}
Also iI have the 10k resistor between Data and powerdata and Vcc pins. Data is connected to digital pin 5. AnyoneHas anyone had this problem before?