Hi
Is there any way I can pass various virtual pins in one single command?
For example, if i have to LOW V1,V2,V3, then I have to write these 3 commands repeateadly
Blynk.virtualWrite(V1, LOW);
Blynk.virtualWrite(V2, LOW);
Blynk.virtualWrite(V3, LOW);
Is there any way I can pass single command instead of 3 different commands?
Please help
Hello, could you please explain how do you see this in code?
I may be wrong, but passing various Blynk.virtualWrite to ESP8266 hangs the network and it starts reconnecting.
I want to use it like this Blynk.virtualWrite(V1,V2,V3, LOW);
I tried this, but this doesn’t work as Blynk.virtualWrite passes single function. Is there any other way around?
In most cases problem in wirings or sketch code and not in virtualWrite itself.
@vshymanskyy what do you think? seems like possible optimization for me.
Yes there may be an issue in code itself but in Blynk docs, it is stated that “Be careful sending a lot of Blynk.virtualWrite commands as most hardware is not very powerful (like ESP8266) so it may not handle many requests.”
and I am sending around 10-12 REQUEST in one push.
That’s why I came up with this idea of reducing the many virtualWrite commands into one. It saves the program size, looks neat but doesn’t work.
Anyone with the solution?
Blynk.virtualWrite(V1,V2,V3, LOW);
…
Currently we can’t do that on the library side.
What is other way around to do so? Use FOR loop?
yes you can!
for (int pin=V1; pin < V4; pin++) {
Blynk.virtualWrite(pin, LOW);
delay(5);
}
this should work. you can put small delay between calls if you want, not more than few ms.
2 Likes
Thanks @vshymanskyy, for your help. In future updates kindly enable atleast 2-3 virtual pins pass through single virtualWrite command.