Hi Blynkers,
I need help with blynk library.
Below is a pseudo code where a FOR structure executes a sample replay that lasts approximately 50 seconds.
I believe Blynk.virtualWite (V0, “example”) will not be properly executed.
During this time (approximately after + - 30 seconds) I receive notification in the app that the hardware has been disconnected.
How can I extend the time the hardware stays connected to the server (+ - 60sec) without changing anything in the void function FunctionExample () ??
Is it something on the side of the Blynk Server or on the side of the Blynk library?
I used this example to simplify because the actual use will be with a command library for stepper motor. That does something similar to the example function.
Thanks for all the help.
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "YourAuthToken";
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
void setup()
{
Blynk.begin(auth, ssid, pass);
pinMode(2, OUTPUT);
}
void loop()
{
Blynk.run();
FunctionExample();
}
void FunctionExample (){
for (word i = 0; i > 50000; i++){ //time of exec. 50+ seconds
digitalWrite(2, LOW);
delayMicroseconds(500); //500 µs = 0.0005 sec
digitalWrite(2, HIGH);
delayMicroseconds(500); //500 µs = 0.0005 sec
}
/*(0.0005 sec * 2) * 50000 = 50 seconds + time functions digitalWrite and delayMicroseconds*/
// lost connection here???? :o
Blynk.virtualWrite(V0, "ok?"); // is send message here???
}