Virtual Button isn't pressed and it goes into endless loop?

Why does the code below endlessly loop into the sub function (blinkled) and blink the virtual LED constantly when i’m not even pressing the virtual button ? [I’m programming the spark photon]

WidgetLED led0(0);
WidgetLED led1(1);

int outputpin = D7;

BLYNK_WRITE(V2) //Button Widget 'OVERRIDE' is writing to pin V2 assigned to one of the buttons
{
    blinkled();
}

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
  pinMode(outputpin,OUTPUT);
  digitalWrite(outputpin,LOW);
  Override = 0;
}

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

//-----------------------------------Sub------------------------

void blinkled()
{
    digitalWrite(outputpin,HIGH);
    delay(2000);
    changeledstate();
    delay(2000);
    changeledstate();
    delay(2000);
    digitalWrite(outputpin,LOW);
}

void changeledstate()
{
    if (led1.getValue()) {
            led1.off();
    }else{
        led1.on();
    } 
}

Hi. You can’t do “delay” in Blynk handlers. BLYNK_WRITE, BLYNK_READ should be executed as fast as possible.

Ok I understand but why won’t this work?:

WidgetLED led0(0);
WidgetLED led1(1);

int inputpin = A1;
int outputpin = D7;
int Override; 

BLYNK_WRITE(V2) //Button Widget 'OVERRIDE' is writing to pin V2 assigned to one of the buttons
{
    Override = 1;
}

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
  pinMode(outputpin,OUTPUT);
  digitalWrite(outputpin,LOW);
  Override = 0;
}

void loop()
{
  Blynk.run();
  if (Override = 1){
      blinkled();
  }
}

//-----------------------------------Sub------------------------

void blinkled()
{
    digitalWrite(outputpin,HIGH);
    delay(2000);
    changeledstate();
    delay(2000);
    changeledstate();
    delay(2000);
    Override = 0;
    digitalWrite(outputpin,LOW);
 //delay(100); 
}

void changeledstate()
{
    if (led1.getValue()) {
            led1.off();
    }else{
        led1.on();
    } 
}

It won’t even do anything when I press the virtual button…

There is a big chance that connection is dropped due to long delays and no activity.

Do you have any suggestions (code wise) as to do what I’m trying to do? Basically I want to enter into a sub function on a button press and turn on a virtual LED… All of your examples use timers and none use a vButton/vLED combo.

Nevermind…I’m a noob at this programming crap!..

it should be:

void loop()
{
  Blynk.run();
  if (Override == 1){
      blinkled();
  }
}