IPAddress as global variable

I wan to set IPAddress as global variable as I want to use IPAddress anyware.

////code start /////////////

IPAddress myIP; //declaration of IPAddress

setup(){

myIP(10,10,10,10); //set ip address here. I want to set IP anywhere.
}

update(){

}

//// end of code /////////////

However error message says “error: no match for call to '(IPAddress) (int, int, int, int)”.
If there is any problem, plz tell me…

Thanks.

}

IPAddress is an array.

2 Likes

Either of these should work:

myIP = IPAddress(192, 168, 1, 20);
myIP = {192, 168, 1, 20};
3 Likes

Thanks, It works…