Blynk.run() in other loops

Hi.

If i need to run a while() loop for a period, would there be any problems putting a Blynk.run() inside the loop to maintain connection with Blynk? I have done some testing, and so far it seems to do the trick. But i just don’t want to waste a lot of time if there is a obvious catch.

Thx in advance :smile:

Hi.
It will work, unless you run out of heap memory (in the cascaded functions with local memory).

For example, it is not recommended to call run() inside of the BLYNK_READ and BLYNK_WRITE functions on low-RAM controllers.

Cheers.

1 Like

Great. Thanks for the help :slight_smile:

I had to do the same. Blynk.run takes too long in order to use simpleTimers bellow 100 millis. So this should help keep the thing alive when turning stepper for long periods.