I would like to know how RTC is synchronized with the server time? is it getting the time only one at RTC.begin(), is it every second or every time I call now() ?
is this code OK (in terms of loading the server, as second() is called in the loop)?
//---------------------------
void loop()
{
Blynk.run(); // All the Blynk Magic happens here…
sec = second();
if(sec1 != sec)
{
sec1 = sec;
Blynk.virtualWrite(0,now());
}
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}
Of course, this is just an example code, I would like to know if such code wll send too many time requests to the server.
If every 5 minuts, then this should be OK.
Yes you are correct. I checked. It is synchronising every 5 minutes.
So this is OK to run 1 Sec interval tasks without a timer.
An even better way might be in some cases to do init sec1 = now(); in setup and then: