// Question:
// Does the ESP32-S3 work with the DHT22 ?
// Answer:
// Probably not.
//
// This project is with the Adafruit "DHT sensor library".
//
// Test1: https://wokwi.com/projects/475345517909932033 (this project)
// Test2: https://wokwi.com/projects/475346162827297793
// Test3: https://wokwi.com/projects/475346465292234753
//
// Only Test3 with the DHTNew library works.
#include <DHT.h>
#define DHTPIN 7
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup()
{
Serial.begin(115200);
dht.begin();
}
void loop()
{
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
Serial.println("Temp: " + String(temperature, 2) + "°C");
Serial.println("Humidity: " + String(humidity, 1) + "%");
Serial.println("-----------------------------");
delay(2000);
}