Created
October 4, 2017 11:11
-
-
Save iotguider/8c5c3e70ea132d8daedba06ccba70cf9 to your computer and use it in GitHub Desktop.
Code for DHT11 Temperature and Humidity Sensor with Arduino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dht.h> | |
dht DHT; | |
#define DHT11_DPIN 8 | |
void setup(){ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
int chk = DHT.read11(DHT11_DPIN); | |
Serial.print("Temperature = "); | |
Serial.println(DHT.temperature); | |
Serial.print("Humidity = "); | |
Serial.println(DHT.humidity); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment