// Code to interface temperature sensor with Arduino to predict Temperature and to measure Humidity value.
#include "dht.h"
#define dht_apin A0
dht DHT;
void setup() {
Serial.begin(9600);
delay(500);
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);
}
void loop() {
DHT.read11(dht_apin);
Serial.print("Current humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
delay(2000);
}
#include "dht.h"
#define dht_apin A0
dht DHT;
void setup() {
Serial.begin(9600);
delay(500);
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);
}
void loop() {
DHT.read11(dht_apin);
Serial.print("Current humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
delay(2000);
}
Online Quiz
Learn all concept on Arduino Tutorial from our channel to get better ideas.
Free E-Certificate will be issued for the participants through mail who secure more than 60% score. Thanks. All the best.
Comments
Post a Comment