Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By danbicks
#26358 Guys,

I have been tinkering with the Easy web Config example. From one the information web page I want to query a boolean variable in the main Ino file. How do I do this, from a .h file to an ino.

I have tried declaring the variable as : extern bool FL_NET_Connected = false; in Ino file
and in header file I do a simple if query:

String Netstate = "N/A";

if bool FL_NET_Connected)
{
Netstate = "Network UP";
}

The IDE complains in the header file that bool FL_NET_Connected is not declared.
Any advice would be great.

Cheers

Dans

Worked it out! Declare in header file: extern bool FL_NET_Connected = false;
now can use in normal routines :)