For loop to set pinmode // invalide us of void expression (debugging)

Hey guys i have this piece of code:

void handleTable(int led, int st) {
  digitalWrite(pin_to_set[led], st);
  server.send(200, "text/html", tt);

i use it to light leds up.
When i try to us it like this:

  server.on ("/table/LED3Off", handleTable(2, 0));

i get:

server.on ("/table/LED3Off", handleTable(2, 0));


exit status 1
invalid use of void expression

i hop someone can help :slight_smile:


    for (int i = 0; i <= 4; i + 1) {

i + 1 isn’t incrementing the value of i. You can do this: i = i + 1, or much more concise: i++.

your right. changed the loop a few times an forgot about that