I do not actually understand the usage of the Preference library.
I would like to reproduce the usage of the PROGMEM storage as follow:
1. Store in PROGMEM a string such as:
Code: Select all
const char control_1 [] PROGMEM = "Coordinator Model: ";
#define MODEL “COOR”
Code: Select all
Serial.print (getString(control_1)), Serial.println (MODEL);
I think I understand that PROGMEM is depreciated and replaced by the ESP32NVS (Non Volatile Storage), however I couldn’t find a decent way to replace the previous configuration.
I have tried the following without success:
Code: Select all
#include <Preferences.h>
Preferences preferences;
void setup ()
{
Serial.begin(115200);
preferences.begin("my-app",false);
preferences.putString("mess_1", "Hello");
preferences.end();
}
void loop ()
{
Serial.println (preferences.getString("mess_1"));
delay (1000);
}
Thanks Robert