#include <LiquidCrystal.h>
#include <DHT.h>
LiquidCrystal lcd(12, 11, 10, 9, 8,7);
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
int led=13;
int chk;
float hum;
float temp;

void setup()
{
  
  lcd.begin(16, 2);
  dht.begin();
  lcd.println("Real time T&H");
  delay(1000);
  lcd.clear();
}

void loop()
{
  lcd.setCursor(0,1);
  hum=dht.readHumidity();
  temp=dht.readTemperature();
  lcd.print("H:");
  lcd.print(hum);
  lcd.print("%,T:");
  lcd.print(temp);
  lcd.println("Celcius");
  delay(2000);
}
Loading
pi-pico-w