Sending Variables!

Hi, this is my first post and I’m spanish, sorry for my english!

int contador
int estado

(value is a char, and is the word after the “=”, on this case contador)

if (strcmp(value,“contador”) == 0)
{
int val = contador;
server.print(val);
}
else if (strcmp(value,“estado”) == 0)
{
int val = estado;
server.print(val);
}

the program returns via web a integer (value of “contador”)

Now I want to compare the value and the name of any public variable. If are the same, send the value of the integer variable.

Any idea? A lot of thanks, pexu!

Now I want to compare the value and the name of any public variable.

Perhaps if you looked at the contents of a hex file that was uploaded to the Arduino, you'd see that this is an impossible task.

Variable names are mapped to addresses in the hex file. The name is not part of the uploaded hex file, so there is no way compare a string to any (non-existent) variable name(s) at run time.

In the code that you have now, you are doing the comparison at compile time, not at run time.