Hi,
I want to use the variable "prozent" in another void function.
IN following function the variable will be set:
int prozent = 0;
.
.
.
void handleIllumination() {
if (myWebServer.webserver->hasArg("light-level")) {
reply = "Illumination level: "; //String reply
reply += myWebServer.webserver->arg("light-level").toInt();
prozent = myWebServer.webserver->arg("light-level").toInt();
Serial.println(reply);
Serial.print("prozent: ");
Serial.println(prozent);
calcreverse();
myWebServer.webserver->send(200, "text/plain", reply);
}
For testing purpose it also prints out at the serial interface.
now the sketch goes on and I wanna use it here:
void calcreverse() {
//positionvalue = steps / 100;
prozent = int(100 * positionvalue) / maxdistance;
positionvalue = maxdistance * prozent / 100;
Serial.print("Prozent: ");
Serial.println(prozent);
Serial.print("maxdistance: ");
Serial.println(maxdistance);
Serial.print("Slider positionvalue: ");
Serial.println(positionvalue);
}
here, the variable "prozent" is just empty.
What I am doing wrong?