Last active
August 2, 2019 15:43
-
-
Save winhtut/b26979d6ecf28906c5427754071e1220 to your computer and use it in GitHub Desktop.
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
//library link https://www.arduinolibraries.info/libraries/simple-dht | |
#include <DHT.h>; | |
#define DHTPIN 2 | |
#define DHTTYPE DHT22 | |
DHT dht(DHTPIN, DHTTYPE); | |
float hum; | |
float temp; | |
void setup() | |
{ | |
Serial.begin(9600); | |
dht.begin(); | |
Serial.println("Welcome to Green Hackers"); | |
} | |
void loop() | |
{ | |
hum = dht.readHumidity(); | |
temp= dht.readTemperature(); | |
Serial.print("Humidity: "); | |
Serial.print(hum); | |
Serial.print(" %, Temp: "); | |
Serial.print(temp); | |
Serial.println(" Celsius"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment