#include "DHT.h" // including the library of DHT11 temperature and humidity sensor
#define DHTTYPE DHT11 // DHT 11
#define dht_dpin 0
DHT dht(dht_dpin, DHTTYPE);
void setup(void)
{
dht.begin();
Serial.begin(9600);
Serial.println("Humidity and temperature\n\n");
delay(700);
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("Current humidity = ");
Serial.print(h);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(t);
Serial.println("C ");
delay(800);
}
#define DHTTYPE DHT11 // DHT 11
#define dht_dpin 0
DHT dht(dht_dpin, DHTTYPE);
void setup(void)
{
dht.begin();
Serial.begin(9600);
Serial.println("Humidity and temperature\n\n");
delay(700);
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("Current humidity = ");
Serial.print(h);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(t);
Serial.println("C ");
delay(800);
}
No comments:
Post a Comment