Blynk_Write parameter to enter and break a loop


New to Blynk and Arduino. I have built the “Autonomous Cooler” and got it working sort of.
The GPS and compass are not very accurate (or my calibration is off…). So, i need to be able to drive the thing manually from the Blynk app.
My first problem:
I use a Virtual Pin to get into a loop that will give me control of the PWM to the motors - that works.
Now, i need to be able to brake that loop when i push the same button again- that does not work.
I do the “while (param.asInt=1)” to enter the loop, but when i push the same button again it should change the value to 0, maybe it does but my loop does not recognise it.
I just can’t figure this out.
Can it be that i need the blynk.virtualSync ?
Do i need to have a delay or timer ?
Seems that i am missing something simple.

Any thoughts ?


Yes, lots… nothing that is even remotely about your issue though, as we don’t know nearly enough to even guess at :stuck_out_tongue:

We are not really a code mechanic shop, but please post your full code, properly formatted as per the Welcome Topic (that everyone reads :stuck_out_tongue_winking_eye: ) and someone may have a suggestion or three.


And then while waiting… please read through the documentation and Help Center files as the odds are very high that you are not using some of the necessary coding practices needed with IoT based communication requirements.