@darkmoon when Blynk introduced the setProperty() function, as a proof of concept, I built my “Space Invaders” game to run on Blynk.
It was simply to familiarise myself with setProperty() and to have some idea of the limitations regarding the frequency at which buttons could be pressed without flooding the server.
I was quite surprised at just how good the server handled rapid button presses and the details of the SmartBlynkie™© are available at SmartBlynkie™© ioT Game
I knocked up your project and guessed at some of your settings:
Few observations / comments:
9600 baud is for “old school” hardware, use 115200 for ESP’s in standalone mode.
Assume display widget for temperature is set at PUSH frequency.
Assume buttons are set as PUSH mode.
Set slider values as 1 to 5. What values are you using?
You declare tiempoX as 0 which would be normal procedure, but as your sketch is written, if the sliders are not moved before you start pressing the buttons then the setTimeouts will also equate to zero.
You could add #define BLYNK_DEBUG as the first line of your sketch but to be honest the debug info doesn’t really help very much.
I added the following to RiegoDani.h:
unsigned int pressed;
and the following to V1:
pressed++;
Serial.println(pressed);
and in CheckConnectionProc() added:
pressed = 0;
I get varying results from your sketch depending on if I move the slider before I start pressing the buttons. I was able to drop the server connection with 3 or 4 rapid button presses on occasions, other times took around 10 button presses and others were as high as 30 button presses.
10 was a fairly common result which makes me think it is due to the maximum of 10 timers running for each instance of SimpleTimer.
You should look at the way you have coded up the setTimeout and as pointed out by @Gunner code up a fix if you think users are going to treat your project as a game of Space Invaders.