Keep getting an error in ESP8266 led control for almost a week !!!

:confused: :confused: :confused: :confused:

i am trying to modify a code from

( In-depth: Create A Simple ESP8266 NodeMCU Web Server In Arduino IDE )

the code is fine working for two leds but as soon as i start to add more pins and LEDs , i keep getting tons of errors !

I’ve lost 10 Pounds last week ! Please help me with this SH** !!! seriously ! :o :o

both Code and the error attached .

Code.txt (9.55 KB)

Error.txt (11.8 KB)

You declare this

String SendHTML(int  led0stat, int  led1stat, int  led2stat, int  led3stat, int  led4stat, int  led5stat, int  led6stat, int  led7stat) { ... }

which is a function that takes 8 integers as arguments, yet you call it like this
SendHTML(LED0status) which is only 1 parameter or this
SendHTML(true, LED1status) which is only 2 parameters

you need to supply ALL the parameters EVERY time.

Your code will also benefit from the use of arrays rather than massive duplication of code everywhere

ok:220:52: error: too few arguments to function 'String SendHTML(int, int, int, int, int, int, int, int)'

   server.send(200, "text/html", SendHTML(LED0status));

The SendHTML function expects 8 int parameters*, you give it only one. If you want to change only one parameter, write an overload of the SendHTML function that takes (and works on) one parameter.

server.send(200, "text/html", SendHTML(true, LED1status));

There is no overload for two parameters, either.

String SendHTML(int  led0stat, int  led1stat, int  led2stat, int  led3stat, int  led4stat, int  led5stat, int  led6stat, int  led7stat)

I know 85 ways to thank you! but you guys deserve : I really appreciate your help !

Thank you blh64 .

Thank you groundFungus .