DHT 11, Suhu Dan Kelembaban Dengan Nodemcu Esp8266 & Aplikasi Blynk
DHT 11, Suhu Dan Kelembaban Dengan Nodemcu Esp8266 & Aplikasi Blynk
com/c/viralscience
//Temperature sensor
/**************************************************************
* http://twitter.com/blynk_app
**************************************************************
* WARNING :
* https://github.com/jfturcot/SimpleTimer
* https://github.com/adafruit/DHT-sensor-library
*
**************************************************************/
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>
char auth[] = " "; //Enter the Auth code which was send by Blink
SimpleTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
void sendSensor()
float h = dht.readHumidity();
if (isnan(h) || isnan(t)) {
return;
}
void setup()
dht.begin();
timer.setInterval(1000L, sendSensor);
void loop()