Skip to content

Instantly share code, notes, and snippets.

@Isaac-the-Man
Created April 18, 2019 10:18
Show Gist options
  • Save Isaac-the-Man/b54e32b5ee0570bfc0cdc0f73c5908ea to your computer and use it in GitHub Desktop.
Save Isaac-the-Man/b54e32b5ee0570bfc0cdc0f73c5908ea to your computer and use it in GitHub Desktop.
#include <dht.h> // essential library for DHT11
#define DHT11_PIN 7
dht DHT;
void setup(){
Serial.begin(9600);
}
void loop()
{
int chk = DHT.read11(DHT11_PIN);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
Serial.println("");
delay(2000); // delay should be at least 2 sec
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment