markruys / arduino-DHT

Efficient DHT library for Arduino
Other
162 stars 119 forks source link

DHT11 to LCD only displays q's but theres no Q in my code? (how do i fix it and make it work?) #28

Open GaMerijn opened 2 years ago

GaMerijn commented 2 years ago

hi, so i'm making an project for school, and I am trying to display the information of an DHT11 to an 16x2 LCD display (1602).

but its only displaying an Q although i dont have an q as lcd.print in my code. `//hier importeren we de juiste librarys

include

include

include

//hier laten we het programma weten wat het I2C adres

//is en dat het een 16 bij 2 beeldscherm is

LiquidCrystal_I2C lcd(0x27,20,4);

define DHTPIN 7 // Digital pin connected to the DHT sensor

// Uncomment whatever type you're using!

define DHTTYPE DHT11 // DHT 11

//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 //#define DHTTYPE DHT21 // DHT 21 (AM2301) DHT dht(DHTPIN, DHTTYPE);

define DHT11_PIN 7

void setup(){

lcd.begin(16, 2);

//hier initializeren we de lampjes van

//het beeldscherm het is belangrijk dat je 2 keer

//lcd.init() hebt wantanders werkt je programma niet

lcd.on();

//lcd.on();

lcd.backlight();

}

void loop()

{

int chk = dht.read(DHT11_PIN);

lcd.setCursor(0,0);

lcd.print("Temp: ");

lcd.print(dht.readTemperature());

lcd.print("C");

lcd.setCursor(0,1);

lcd.print("Humi: %");

lcd.print(dht.readHumidity());

delay(2000);

}` 20211207_085444

image