// this code is developed by YASH JAYALE you can contact on telegram :- https://t.me/yashjayale
// to add the esp8266 boards in your arduino ide you have to use this link as shown in the video
// http://arduino.esp8266.com/stable/package_esp8266com_index.json
//also you have to install libraries as shown in the video
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define BLYNK_AUTH_TOKEN"YDaHM5WWlwoUph5zPXgZQhRss28Ow9_Q"
char auth[]=BLYNK_AUTH_TOKEN;
char ssid[]="Wi-fight the feelings 🥱🥴";// your wifi name
char pass[]="sk saravanan";// your wifi password
int gate_ir = D0 ;
BLYNK_WRITE(V0){
digitalWrite(D0,param.asInt());
}
void setup() {
// put your setup code here, to run once:
pinMode(D0,INPUT);
Blynk.begin(auth,ssid,pass,"blynk.cloud",80);
}
void loop() {
// put your main code here, to run repeatedly:
Blynk.run();
int s1 = digitalRead (gate_ir);
if (s1==LOW)
{
Blynk.virtualWrite(V1,"GATE:CLOSED");// YOU CAN CHANGE THIS TEXT ACCORDING TO YOUR PROJECT
Blynk.virtualWrite(V2,"SECURED");// YOU CAN CHANGE THIS TEXT ACCORDING TO YOUR PROJECT
Blynk.virtualWrite(V3,HIGH);//TURN ON RED LED
Blynk.virtualWrite(V4,LOW);//GREEN LED IS OFF
}
else{
Blynk.virtualWrite(V1,"GATE: OPEN");// YOU CAN CHANGE THIS TEXT ACCORDING TO YOUR PROJECT
Blynk.virtualWrite(V2,"CHECK THE DOOR");// YOU CAN CHANGE THIS TEXT ACCORDING TO YOUR PROJECT
Blynk.virtualWrite(V3,LOW);//GREEN LED IS OFF
Blynk.virtualWrite(V4,HIGH);//GREEN LED IS ON
}
}
Loading
esp32-s2-devkitm-1
esp32-s2-devkitm-1