#include <DHT.h>
#define DHTPIN 9
#define DHTTYPE DHT22
DHT dht (DHTPIN, DHTTYPE);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float temp = dht.readTemperature();
float hum = dht.readHumidity();
delay(2000);
Serial.print("Temperature: ");
Serial.print(temp);
Serial.print(" | Humidity: ");
Serial.println(hum);
delay(1000);
}