#define BLYNK_TEMPLATE_ID "TMPLY5NMOqwF"
#define BLYNK_DEVICE_NAME "led control"
#define BLYNK_AUTH_TOKEN "ErwCPoA79n_qc62UJuKN3HiHUBGbFwcv"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Vishnu";
char pass[] = "1234567890";
int sensor = D1;
int data = 0;
int sensorThres = 100;
BlynkTimer timer;
void sendSensor(){
int data = digitalRead(sensor);
data=!data;
Blynk.virtualWrite(V0, data);
Serial.print("sensor: ");
Serial.println(data);
}
void setup(){
pinMode(sensor, INPUT);
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
//dht.begin();
timer.setInterval(2500L, sendSensor);
}
void loop(){
Blynk.run();
timer.run();
}