-->
Page 1 of 1

How to send int value to html asyncwebserver nodemcu

PostPosted: Tue Sep 15, 2020 4:27 pm
by kendralz
Hi good day to all and please welcome me to this forum

I just wanna ask on How to to send int value to html asyncwebserver

Here's my sample code


Code: Select all#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>

int btnCount=0;

const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE HTML><html>
<body>

 
 
</body></html>)rawliteral";



void ICACHE_RAM_ATTR btnPush()
{
   btnCount ++;

}

void setup () {

attachInterrupt(D6, btnPush, RISING);
pinMode(D6, INPUT);


server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send_P(200, "text/html", index_html, processor);
  });

  server.begin();

}

void loop {



}


All i want to do is when i press the pushbutton "btnCount" will appear on html webserver

Hope you help me w/ this thank you MORE POWER