#include <DHT.h>
#define DHTPIN1 4
#define DHTPIN2 5
#define DHTTYPE DHT22
DHT dht1(DHTPIN1, DHTTYPE), dht2(DHTPIN2, DHTTYPE);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
dht1.begin();
dht2.begin();
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int temp1 = (int)dht1.readTemperature();
int hum1 = (int)dht1.readHumidity();
int temp2 = (int)dht2.readTemperature();
int hum2 = (int)dht2.readHumidity();
Serial.printf("DHT1: %d ํc %d%%RH\n", temp1, hum1);
Serial.printf("DHT2: %d ํc %d%%RH\n", temp2, hum2);
delay(2000);
}