Created
September 28, 2018 04:53
-
-
Save li2hub/862c900e25af4c366caf898234c05938 to your computer and use it in GitHub Desktop.
This file contains 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> | |
#define DHTPIN D5 | |
#define DHTTYPE DHT11 | |
DHT dht(DHTPIN, DHTTYPE); | |
uint8_t temperature, humidity; | |
void setup() { | |
Serial.begin(115200); | |
dht.begin(); | |
delay(10); | |
Serial.println(); | |
Serial.println(); | |
} | |
void loop() { | |
temperature = dht.readTemperature(); | |
humidity = dht.readHumidity(); | |
delay(500); | |
Serial.print("Temperature Value is :"); | |
Serial.print(temperature); | |
Serial.print("C"); | |
Serial.print(" Humidity Value is :"); | |
Serial.print(humidity); | |
Serial.println("%"); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment