#include <DHT.h>
const int pinDHT = 3;
char DHTTYPE = DHT22;
DHT dht(pinDHT, DHTTYPE);
float temp;
float hum;
void setup() {
Serial.begin(9600);
Serial.println("Mengaktifkan Sensor DHT22");
dht.begin();
}
void loop() {
temp = dht.readTemperature();
hum = dht.readHumidity();
delay(1000);
Serial.print("Temperature : ");
Serial.print(temp);
Serial.print(" Celcius \t");
Serial.print("Humidity : ");
Serial.print(hum);
Serial.println(" %");
}