Skip to main content
added 71 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 43
  • 59

Change

else if (isButtonPressed==0 && flag==0)   
    Blynk.notify("Alert : Water level has risen");

to

else if ((isButtonPressed==0) && (flag==1)   )
{
    Blynk.notify("Alert : Water level has risen");
}

Otherwise, when flag == 1, it will never revert back to 0. Also it's best to add brackets, and use parenthesis.

Also, change the variable name flag to something more meaningfull.

Change

else if (isButtonPressed==0 && flag==0)   
    Blynk.notify("Alert : Water level has risen");

to

else if (isButtonPressed==0 && flag==1)   
    Blynk.notify("Alert : Water level has risen");

Otherwise, when flag == 1, it will never revert back to 0.

Also, change the variable name flag to something more meaningfull.

Change

else if (isButtonPressed==0 && flag==0)   
    Blynk.notify("Alert : Water level has risen");

to

else if ((isButtonPressed==0) && (flag==1))
{
    Blynk.notify("Alert : Water level has risen");
}

Otherwise, when flag == 1, it will never revert back to 0. Also it's best to add brackets, and use parenthesis.

Also, change the variable name flag to something more meaningfull.

Source Link
Michel Keijzers
  • 13k
  • 7
  • 43
  • 59

Change

else if (isButtonPressed==0 && flag==0)   
    Blynk.notify("Alert : Water level has risen");

to

else if (isButtonPressed==0 && flag==1)   
    Blynk.notify("Alert : Water level has risen");

Otherwise, when flag == 1, it will never revert back to 0.

Also, change the variable name flag to something more meaningfull.