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

Slider value sets to 0 after reconnect

Hi this my first time here, i tried to control led brightness by slider, everything is fine except when the esp lost connection and reconect then the slider value sets to zero by itself my sketch is nothin but nodemcu blynk wifi sample, so how to keep the slider value as it was.
Thanks in advance

Search for “Blynk.syncVirtual” and “BLYNK_CONNECTED”

Pete.

can you give me a live example on my sketch



#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "jx-Bb5F9GRGA9MvgUkEk5DrXK6gndjgD";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ASUS";
char pass[] = "11111111";

void setup()
{
  // Debug console
  Serial.begin(9600);

  //Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8080);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

}

void loop()
{
  Blynk.run();
} ```

@Zeo 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.

done

Have you bothered to search as I suggested?
What did you find?

Pete.

i got it ,thankyou sir