Why Serial Monitor shows double "Getting your variable"?


Why Serial Monitor shows double “Getting your variable” which is triggering “Gatekeeper test if”?

Getting your variable:
Value: 1.00
Value: 1.00

void loop() {

    float value = client.getValue(ID);
    Serial.print("Value: ");  // 
  if (value == 1.00)  {  // Gotcha command from Google home
digitalWrite(garage,value);   // Change pin value - Switch relay on and off
delay(700); // Press and hold garage button for X sec

       Serial.print("Value: ");
     delay(20000); // Wait until door closed 20 sec.
float value=0.00; 
client.add(ID, 0.00);  // Sending back to Ubidots value 0

// gatekeeper test
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis <= interval) {  
    previousMillis = currentMillis;   // save the last time value=0.00;

because you are printing it twice?

Yeah . . . . have you bothered to read your own code? Even if it isn't yours, you should at least bother to read what you copy/pasted.

Read it line by line. Start from the top. Every time you see "Serial.print", drink. Repeat until you figure it out or stop caring.

UGH... You are right guys. :o

But my main concern was Why it's triggering"Gatekeeper test IF"?

When actually only once "Value: 1.00" appear after first IF.

    previousMillis = currentMillis;   // save the last time value=0.00;

That is NOT what that code is doing. If you used some meaningful names for now and then, you’d learn that it is no mystery WHEN you need to assign a value to the then variable, and you’d KNOW that that comment is nonsense.