#define BLYNK_TEMPLATE_ID "TMPLVxpidQUT"
#define BLYNK_TEMPLATE_NAME "Light"
#define BLYNK_AUTH_TOKEN "8SUtaU63dbYmJx6eAVRVfTyWZUc3DCHe"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "vivo 1609";
char pass[] = "1234567890";
int sensor1 = D0;
int sensor2 = D1;
int sensor3 = D2;
int data1 = 0;
int data2 = 0;
int data3 = 0;
int sensorThres = 100;
BlynkTimer timer;
void sendSensor(){
int data1 = digitalRead(sensor1);
Blynk.virtualWrite(V0, data1);
Serial.print("sensor: ");
Serial.println(data1);
int data2 = digitalRead(sensor2);
Blynk.virtualWrite(V1, data2);
Serial.print("sensor2: ");
Serial.println(data2);
int data3 = digitalRead(sensor3);
Blynk.virtualWrite(V2, data3);
Serial.print("sensor3: ");
Serial.println(data3);
}
void setup(){
pinMode(sensor1, INPUT);
pinMode(sensor2, INPUT);
pinMode(sensor3, INPUT);
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
timer.setInterval(2500L, sendSensor);
}
void loop(){
Blynk.run();
timer.run();
}