Blynk.end() command

It would be a good thing to have an Blynk.end() command so that you can stop all processes from Blynk.
Because in my project, for example, I only need blynk to change settings via bluetooth.
But after changing the settings it would be cool if I could turn off Blynk with the push of a button.

So you can write code like:

void.loop(){
Int buttonpress;

If(buttonpress==1){
Blynk.begin();
++buttonpress;
}
If(buttonpress==2){
Blynk.run();
}
If(buttonpress>3){
Blynk.end();
buttonpress=0;
}
}

1 Like

I’m not sure why Blynk.disconnect() doesn’t meet your needs.
Of course, the major drawback to this approach is that once you’ve disconnected/stopped Blynk then any future presses of a widget button (assuming that’s what you’re referring to) won’t be seen by the hardware so you can’t turn Blynk back on again.

Pete.

So I’m currently building a Lightsaber that only has one button. Therefore i change the settings (like color sounds etc.) via bluetooth with blynk. To activate Blynk I have to hold the button down, and so would I also disable it again.

The problem is if blynk.begin is in the void.setup, everything in the void.loop does not work until the first connection has been established.

In addition, Blynk consumes power and electricity even when I don’t need it, and since my project runs on batteries, that’s counterproductive.

So use Blynk.config and Blynk.begin instead.

I’m not convinced that stopping Blynk would solve that, unless you turn-off the BTY adapter in your sketch, but Blynk.disconnect will end the communication between the BT adapter and your phone.

Pete.