I want to use blynk and I need delays whereby the rest of the code IS NOT running (I’d rather not use new libraries or call millis() every single time), my understanding is that the Blynk.run() function needs to be called upon over and over to prevent it from disconnecting. Will this function solve my problem ?
void MyDelay(int DelayTime)
{
unsigned long timenow = millis();
unsigned long TimeAtEnd = timenow + DelayTime;
for( ; ; )
{
Blynk.run();
if (millis()>=TimeAtEnd)
break;
}
}
@Firfas please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Copy and paste these characters if you can’t find the correct character on your keyboard.
Also, your topic title says “non-blocking delay”, but your description says that you need a method of blocking all other code execution.