 /******************************
    INTERACTION LAYER
  ******************************/
-
 
 bool didResetMode = false;
 void checkButton() {

*/
void saveFile(String newFileContent) {
  debugMessage("saveFile() BEGIN!");
  removeFile();
  uint8_t flashBuffer[CONTENT_SIZE + 1];
  newFileContent.getBytes(flashBuffer, CONTENT_SIZE + 1);
  SerialFlashFile file;

  debugMessage("saveFile() Creating file if not exist...");
  // Create the file if it doesn't exist
  if (!create_if_not_exists(filename)) {
    Serial.println("Not enough space to create file " + String(filename));
    digitalWrite(ledPin, HIGH);
    return;
  }

  debugMessage("saveFile() Opening file for write!");
  // Open the file and write test data
  file = SerialFlash.open(filename);
  parpadear (3, 50);

  debugMessage("saveFile() Writing into file...!");
  file.write(flashBuffer, CONTENT_SIZE + 1 );

    addKey("91011");
    addKey("121314");
    addKey("151617");
    addKeyMode = false;
  }
}

