Esp8266 + Blynk + Button

Light switch

This beautiful code is in all of my light switch but can not finish so that you can beat the light off with the button on the switch

Етот код стоит во всех моих Выключателей Света но не могу доделать так чтоб можна било свет выключить с кнопки на самом выключателе

    #define BLYNK_PRINT Serial
    #include <ESP8266WiFi.h>
    #include <BlynkSimpleEsp8266.h>
    #include <OneWire.h>
    #include <DallasTemperature.h>
    #include <TimeLib.h>
    #include <SimpleTimer.h>
    #define Thermometer 10

    // Pin 10 - Gpio 10

    OneWire oneWire(Thermometer);
    DallasTemperature sensors(&oneWire);

    char auth[] = "cb9e0b23ca35429882f6a6658713174e";

    SimpleTimer timer;

    void setup()
    {
      Serial.begin(9600);
      Blynk.begin(auth, "Tp-link", "Ms0606400");

      sensors.begin();

      timer.setInterval(2000L, sendTemps);
    }

    void sendTemps()
    {
      sensors.requestTemperatures();

      float tempBabyRoom = sensors.getTempCByIndex(0);

      Blynk.virtualWrite(0, tempBabyRoom);
    }

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

Here’s the code for the button

int Rele=0;

void setup() {
  pinMode(8,OUTPUT); 
  pinMode(11,INPUT);
}
void loop() {
  if (digitalRead(11)==1 && Rele ==0) 
    {
       digitalWrite(8,HIGH); 
       Rele =1;
       while (digitalRead(11))
         delay(50);
    }
   if (digitalRead(11)==1 && Rele ==1)
    {
       digitalWrite(8,LOW);
       Rele =0;
       while (digitalRead(11))
         delay(50);         
    }
}

Help dining in one code

@Mindezek we have ready examples for your case. Look here :

https://github.com/blynkkk/blynk-library/blob/master/examples/More/SyncPhysicalButton/SyncPhysicalButton.ino
https://github.com/blynkkk/blynk-library/blob/master/examples/More/ButtonInterrupt/ButtonInterrupt.ino
https://github.com/blynkkk/blynk-library/blob/master/examples/More/ButtonPoll/ButtonPoll.ino

All links are invalid
ERROR 404

@safari if you are using the Arduino IDE you have all the examples on your computer and can access them in the IDE.

If you are not using the Arduino IDE or an example becomes available in the master branch before an official release you should familiarise yourself with Blynk’s GitHub.

Just start at https://github.com/blynkkk/blynk-library and explore.

I’ve found it in more/sync/… thanks!