I am writing a simple clock program for the M5Stack, synchronized with a time server using the ezTime library GitHub - ropg/ezTime: ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
The situation is shown in the figure.
In the program void setup(void) this library works.
The void loop() program does not work. The error is shown in the figure.
I understand that the problem is in declaring the scope of variables. But any of my attempts to rectify the situation did not lead to success.
I posted the full program code at https://pastebin.com/HwFcJfQ1
I would be grateful for the help in correcting the code.
I’m wondering how to properly declare the functions of the link libraries in the individual function called functions ()? For example, the operator of the WiFi.h library of the form
if (WiFi.status ()! = WL_CONNECTED)
may not work if it is put into an external function.
The task is to access all the functions of the ezTime library for a given time zone and from the second part of the program too. Actual, for example, if at initial start-up there is no connection with WiFi. Or we want to write a separate subroutine with a call to these functions.