mmc01
May 8, 2021, 4:07am
1
I can get data when I change numeric input in blynk with this code.
BLYNK_WRITE(V4)
{
time_log = param.asInt();
}
void loop() {
Blynk.run();
timer.run();
now = rtc.now();
Serial.print("Time Log: ");
Serial.println(time_log);
if(now >= next_log){
next_log = now + (time_log*60);
Serial.print("Run");
}
delay(3000);
}
I can get time_log from BLYNK_WRITE(V4) when I change numeric input in blynk. when I reboot ESP32 it not get data from blynk until I change numeric input in blynk again. Can I get data from blynk after reboot ESP32 ?
Hi !
You can add Blynk.syncVirtual(V4) in your setup.
Read the " Synchronising the output state with the app at startup " section of this topic:
I thought I’d write a guide about how to use virtual pins with app widgets such as buttons, to control physical devices such as relays, LEDs etc…
Why use virtual pins anyway?
I’d always recommend using virtual pins over physical pins when developing your code. There are a number of reasons, but here are what I consider to be the main ones:
Virtual pins are hardware independent. This means that it’s far easier to port your code from one hardware platform to another in future (when you realise…
Pete.
Also the KILLER delay in the void loop. Search “clean void loop”
You can’t use that in the loop, use timers instead
mmc01:
delay(3000);