BLYNK_WRITE(V21) //Function Mode 1
{
int Mode1 = param.asInt(); //Get value from Button V21
if (Mode1 == 1) { //if it is HIGH
varMode1++; //count the flag “varMode1” ++
}
if (varMode1 == 2) { //if the Button get pushed a second one
varMode1= 0; //flag “varCentralOut” is again 0
}
As Mode1 will never be 2 if the button is sending 1 and 0
No mode1 is only the status from the button. I know it can be only 1 or 0… if this button is clicked I sai to the variable varMode1 count on. By the first click it counts to 1. By the second click it counts to 2, but immediatelly after I say if varMode1 == 2, varMode1 = 0. So it can begin from new
Sorry there was an error by my side, that happens if you code on blynk website.
But also if I write it like you, and also in my sketch it does not work. My question: How to compare two variables? There must be the error because in serial monitor I see if I click on Button from Mode 1 that varMode1 == 1 and the same also with the Button centralOut. But I never get the varLedOutput == 1. It remains usually 0. Tomorrow I will copy my original sketch here.
Thx. in the meantime