Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#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