BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

LED automatically ON on first Blynk Connect

I am using NODE MCU ESP8266 With Blynk app,
Problem : - When connecting to Blynk first time after power reset ESP8266 GPIO connected LED automatically ON whiteout button press.

Program as Below.

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).

char auth[ ] = "xxxxxxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.

char ssid[ ] = "xxxxx";
char pass[ ] = "xxxxxxx";

WidgetLED led1(V1);
BlynkTimer timer;

// V1 LED Widget is blinking
int DO4,DO5;

  int value,value1;





void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

}

//In the loop function include Blynk.run() command.
void loop()
{
  Blynk.run();
  timer.run(); 
 

  DO4 =  digitalRead(4);
  DO5 =  digitalRead(5);
  if(DO4==HIGH)
  {
   Blynk.virtualWrite(V8,0);
  }
  else
   {
    Blynk.virtualWrite(V8,255);       //LED "LOW"
   }

  if(DO5==HIGH)
  {
   Blynk.virtualWrite(V9,0);
  }
  else
   {
    Blynk.virtualWrite(V9,255);       //LED "LOW"
   }
   
}

@Mitesh_Patel please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Got Solution

Blynk.syncAll();

Thanks.

but the led turn on for 2 sec and then turn back off which is something bad if u connected a relay