From 00f01de240d1c0263f2946077b662420325b1131 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Mon, 28 Oct 2019 18:38:45 +0530 Subject: [PATCH] minimal changes --- data/manualMode.txt | 3 +++ src/sketch_oct17esp.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 data/manualMode.txt diff --git a/data/manualMode.txt b/data/manualMode.txt new file mode 100644 index 0000000..1f41a10 --- /dev/null +++ b/data/manualMode.txt @@ -0,0 +1,3 @@ +{ + "manual": "False" +} diff --git a/src/sketch_oct17esp.cpp b/src/sketch_oct17esp.cpp index ab7557a..84e7d23 100755 --- a/src/sketch_oct17esp.cpp +++ b/src/sketch_oct17esp.cpp @@ -62,8 +62,7 @@ OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); const int SENSOR_RESOLUTION = 12; unsigned long lastTempRequest = 0; -const unsigned int delayInMillisSensors = 750 / (1 << (12 - SENSOR_RESOLUTION)); -; +const unsigned int delayInMillisSensors = 750 / (1 << (12 - SENSOR_RESOLUTION)) + 100; ESP8266WiFiMulti wifiMulti; // Create an instance of the ESP8266WiFiMulti class, called 'wifiMulti' @@ -291,9 +290,9 @@ void loop() temperatures.add(sensors.getTempCByIndex(0)); root.prettyPrintTo(Serial); root.prettyPrintTo(temperaturesJson); - dtostrf(sensors.getTempCByIndex(0), 1, 1, str_temp); - sprintf(b, "%s", str_temp); - tft.drawString(str_temp, coordinates.x[3], coordinates.y[3], 2); + // dtostrf(sensors.getTempCByIndex(0), 1, 1, str_temp); + // sprintf(b, "%s", str_temp); + // tft.drawString(str_temp, coordinates.x[3], coordinates.y[3], 2); // Serial.println(sensors.getTempCByIndex(0)); // Serial << "Delay: " << delayInMillisSensors << endl; sensors.requestTemperatures(); @@ -757,14 +756,15 @@ void handleManual() { root["manual"] = "False"; } - root.printTo(file); + root.prettyPrintTo(file); file.close(); combineSettings(); // digitalWrite(ESP_TO_ARDUINO_PIN, 1); displayCombinedSettings(); // digitalWrite(ESP_TO_ARDUINO_PIN,1); - server.sendHeader("Location", "/manualMode.html"); // Redirect the client to the success page - server.send(303); + // server.sendHeader("Location", "/manualMode.html"); // Redirect the client to the success page + // server.send(303); + server.send(200); } void handleSettings() {