Created
October 10, 2017 09:15
-
-
Save ktinkerer/a48556dc0ff3b7b06e7d9a323f53aede 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 2 | |
#define DHTTYPE DHT22 | |
DHT dht(DHTPIN, DHTTYPE); | |
void setup(void) { | |
Serial.begin(9600); | |
dht.begin(); | |
} | |
void loop(void) { | |
float h = dht.readHumidity(); | |
// Read temperature as Celsius (the default) | |
float t = dht.readTemperature(); | |
Serial.print(" Humidity: "); | |
Serial.print(h); | |
Serial.print(", Temperature: "); | |
Serial.println(t); | |
delay(60000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment