diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index 3a7a81e..b840c45 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -37,6 +37,11 @@ const char* PARAM_STRING = "inputString"; const char* PARAM_INT = "inputInt"; const char* PARAM_FLOAT = "inputFloat"; +// Global variables +String yourInputString; +int yourInputInt; +float yourInputFloat; + // HTML web page to handle 3 input fields (inputString, inputInt, inputFloat) const char index_html[] PROGMEM = R"rawliteral(
@@ -267,22 +272,23 @@ void setup() { digitalWrite(output27, LOW); // Initialize SPIFFS - #ifdef ESP32 + SPIFFS.begin(true); + //#ifdef ESP32 if(!SPIFFS.begin(true)){ Serial.println("An Error has occurred while mounting SPIFFS"); return; } - #else + //#else if(!SPIFFS.begin()){ Serial.println("An Error has occurred while mounting SPIFFS"); return; } - #endif + //#endif // Read in existing data -// String yourInputString = readFile(SPIFFS, "/inputString.txt"); -// int yourInputInt = readFile(SPIFFS, "/inputInt.txt").toInt(); -// float yourInputFloat = readFile(SPIFFS, "/inputFloat.txt").toFloat(); + yourInputString = readFile(SPIFFS, "/inputString.txt"); + yourInputInt = readFile(SPIFFS, "/inputInt.txt").toInt(); + yourInputFloat = readFile(SPIFFS, "/inputFloat.txt").toFloat(); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); @@ -306,21 +312,23 @@ void setup() { if (request->hasParam(PARAM_STRING)) { inputMessage = request->getParam(PARAM_STRING)->value(); writeFile(SPIFFS, "/inputString.txt", inputMessage.c_str()); + yourInputString = inputMessage; } // GET inputInt value on