/* * ESP32 AJAX Demo * Updates and Gets data from webpage without page refresh * https://circuits4you.com */ #include #include #include #include "index.h" //Web page header file WebServer server(80); //Enter your SSID and PASSWORD const char* ssid = "your network name"; const char* password = "your network password"; int lastMeasureTime; int arrayLength = 4; int capPins[] = {4,12,27,32}; int holdTimes[] = {0,0,0,0}; int totalTime = 0; float defaultReadings[] ={0,0,0,0}; // updates in calibration float currentReadings[] ={0,0,0,0}; // updates in calibration float threshold = -1.8; bool booleans[] ={0,0,0,0}; int readings = 5; int maxcapacitance = 20; // currently not being used //=============================================================== // This routine is executed when you open its IP in browser //=============================================================== void handleRoot() { String s = MAIN_page; //Read HTML contents server.send(200, "text/html", s); //Send web page } void calibration(){ int sum = 0; String s = "Calibr Done:"; for(int n = 0; n 1000){ measure(); lastMeasureTime = millis(); } server.handleClient(); delay(1); }