Nothing appears on lcd1602 display

Hello,
I’ve followed a tutorial on a simple weather station by a guy called Techmaker on youtube, if you want to check it out heres a linkhttps://www.youtube.com/watch?v=2sYKcozjvXA.

I use an arduino uno R3
I get no error codes when i upload and compile, but i can’t see my dht11 readings on my lcd1602 display (the display is with i2c), is there someone who can help me troubleshoot?

Picture of the display after upload of the code is attached

#include <Wire.h>  
#include <LiquidCrystal_I2C.h>

#include "DHT.h"
#define DHTPIN 5     //digital pin sensor

// Uncomment whatever type you're using!

  #define DHTTYPE DHT11      // DHT 11
  //#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
  //#define DHTTYPE DHT21

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);



DHT dht(DHTPIN, DHTTYPE);



void setup() {
  
  lcd.begin(16, 2);
  
  dht.begin();
 

}

void loop() {

 delay(1000);
  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
   lcd.print("NO CONNECTION");
    return;
  }

 
  lcd.setCursor(0, 0);
  lcd.print(h);
  lcd.print(" % ");
  
  lcd.print(t);
  lcd.print(" C");




}

}

There is nothing in that sketch which has anything to do with an LCD: all the output there is to the serial monitor.

Hello,
i'm really sorry, i uploaded the wrong code. I've changed it now to be the code that includes the lcd

(deleted)

Have you run the i2c scanner to verify if the lcd is detected?

Do you get anything if you were to do say an lcd.print("welcome"); in setup()?

Do you get anything if you run whatever "hello world" type test sketch comes with the i2c lcd library?

The problem was that i had the wrong i2c addres, ive changed it to 0x27 which is my address. But know the lcd screen reads "No connection". Does that mean that my dht11 is faulty?

andreas4955:
But know the lcd screen reads "No connection". Does that mean that my dht11 is faulty?

Are you sure it's an 11 not a 21 or 22, which would require changing which one of these is in play:

#define DHTTYPE DHT11      // DHT 11
  //#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
  //#define DHTTYPE DHT21

Hello!
The problem was the i2c address, i changed that. And found a faulty jumper cable, and now i works! thank you for your time and help!

(deleted)