hello greetings, I have created this app in mit to communicate with a web component with an esp8266 in arduino ide I have a problem that I have not been able to solve, in the app I created 4 buttons with their labels where I press the increase and decrease buttons of each variable that It comes to me from esp 8266 and I visualize, the problem is the following when I press a button the corresponding variable is increased but when I press another button the same variable is increased by one value and then the other. In the arduino code I send the data through client.print () and I receive them in the app and I separate them with "," I attach the blocks
if (header.indexOf("GET /dec_timeCL1") >= 0) {
if (CilindroPUSH_ON > 0) {
CilindroPUSH_ON -= 1000;
;
}
}
if (header.indexOf("GET /inc_timeCL1") >= 0) {
if (CilindroPUSH_ON < 10000) {
CilindroPUSH_ON += 1000;
}
}
//******************************DELAY CILINDRO PUSH***************************************
if (header.indexOf("GET /dec_delayCL1") >= 0) {
if (CilindroPUSH_OFF > 0) {
CilindroPUSH_OFF -= 1000;
}
}
if (header.indexOf("GET /inc_delayCL1") >= 0) {
if (CilindroPUSH_OFF < 10000) {
CilindroPUSH_OFF += 1000; // increment the value by 1000
}
}
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println("Connection: close");
client.println();
client.print(CilindroPUSH_ON / 1000);
client.print(",");
client.print(CilindroPUSH_OFF / 1000);
client.print(",");
client.print(CilindroRETENEDOR_ON / 1000);
client.print(",");
client.print(CilindroRETENEDOR_OFF / 1000);
client.print(",");```