Visibility of ezTime library variable names for M5Stack


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
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.


Not posting code is the worst thing you can do. Not using code tags when posting code is second. Posting pictures of code is right up there at the top of the list of reasons for being ignored.

You have variables that are local to setup() that you are trying to use in loop(). The ONLY variables that you can use in loop() are those that are global or are local to loop().

Variable scope is a mandatory topic to understand if you want to be a programmer instead of a copy/paste/hope-like-hell-it-works type.

Could be that LuntikWatch is not a programmer (It says Newbie at his profile, just like me). Could be that he browses the internet and is copying code from others.

But you PaulS are not so good in communication.

Please let's help each other instead of humiliate...