#include <DHT.h> // temp & humid
#define DHTPIN 25
#define DHTTYPE DHT11
DHT dht(25,DHT11); // It is object for temp & humid
int h=0;
int t=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
dht.begin();
pinMode(25, INPUT); //DHT11 , data
}
void loop() {
// put your main code here, to run repeatedly:
int h = dht.readHumidity(); // ดึงค่าความชื้น
int t = dht.readTemperature(); // ดึงค่าอุณหภูมิ
Serial.print("Hum(%): ");
Serial.println(h);
Serial.print("Temp(C): ");
Serial.println(t);
delay(3000);
}