Skip to content

Instantly share code, notes, and snippets.

@li2hub
Created September 28, 2018 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save li2hub/862c900e25af4c366caf898234c05938 to your computer and use it in GitHub Desktop.
Save li2hub/862c900e25af4c366caf898234c05938 to your computer and use it in GitHub Desktop.
#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