Skip to content

Instantly share code, notes, and snippets.

@xxlukas42
Created September 15, 2018 11:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxlukas42/cdf47658928135eb7af9ace75336e451 to your computer and use it in GitHub Desktop.
Save xxlukas42/cdf47658928135eb7af9ace75336e451 to your computer and use it in GitHub Desktop.
DHT12 shield for D1 mini Pro
// Install https://github.com/wemos/WEMOS_DHT12_Arduino_Library first
#include <WEMOS_DHT12.h>
DHT12 dht12;
void setup() {
Serial.begin(115200);
}
void loop() {
if(dht12.get()==0){
Serial.print("Temperature in Celsius : ");
Serial.println(dht12.cTemp);
Serial.print("Temperature in Fahrenheit : ");
Serial.println(dht12.fTemp);
Serial.print("Relative Humidity : ");
Serial.println(dht12.humidity);
Serial.println();
}
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment