#include "DHT.h"

#define DHTPIN 4 // Define the GPIO pin where the DHT sensor is connected
#define DHTTYPE DHT22 // Change this to DHT11 if you're using a DHT11 sensor

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200); // Initialize Serial communication
  dht.begin(); // Initialize the DHT sensor
}

void loop() {
  delay(2000); // Wait for 2 seconds between readings

  float humidity = dht.readHumidity(); // Read humidity from the DHT sensor
  float temperature = dht.readTemperature(); // Read temperature in Celsius from the DHT sensor

  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor. Check wiring.");
    return;
  }

  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
}
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
dht1:VCC
dht1:SDA
dht1:NC
dht1:GND