#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "YourAuthToken";
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
BlynkTimer timer;
int led = 2;
int button = 3;
void repeat() {
if ((digitalRead(button)) == HIGH) {
digitalWrite(led, HIGH); }
else {
digitalWrite(led, LOW); }
}
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(button, INPUT);
timer.setInterval(1000L, repeat);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
timer.run();
}
i need to continue that led & button code even if blynk not connected to server while booting.
my issue is to avoid stuck code while booting while not connected to wifi