Hi! Anyone could help with this?
I am getting what I think is a time out message on my nano in the serial data in Arduino IDE.
Any pointers would be cool!
I have 10k resistor on the data pin,
#include <Wire.h>
#include <DHTStable.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
DHTStable dht;
hd44780_I2Cexp lcd;
#define DHT11_PIN 2
const int LCD_COLS = 16;
const int LCD_Rows = 2;
int buttonState1 = 0;
const int But2 = 11;
int buttonState = 0;
const int But1 = 12;
byte termometru[8] = {
B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110}; //chart for temperatura
byte picatura[8] = {
B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110,}; //char for humidity
void setup()
{
DHTStable();
lcd.begin(20, 4);
Serial.begin(9600);
Serial.println(__FILE__);
Serial.print("LIBRARY VERSION: ");
Serial.println(DHTSTABLE_LIB_VERSION);
Serial.println();
Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)\tTime (us)");
}
void display()
{
lcd.write(1);
lcd.setCursor(0, 1);
lcd.print(dht.getTemperature());
lcd.print(" ");
lcd.print((char)223);
lcd.print("C");
lcd.setCursor(10, 1);
lcd.write(2);
lcd.print(dht.getHumidity());
lcd.print(" ");
lcd.print("%");
}
void buton()
{
buttonState = digitalRead(But1);
delay(10);
if (buttonState == HIGH)
{
lcd.backlight();
}
else {
lcd.noBacklight();
}
}
void loop()
{
int chk = dht.read11(DHT11_PIN);
delay(2000);
buton();
Serial.print("T: ");
Serial.println(dht.getTemperature());
Serial.print("H: ");
Serial.println(dht.getHumidity());
}
and the error message;
Type, status, Humidity (%), Temperature (C)
DHT11, Time out error, -999.0, -999.0