I am trying to save a string/char to EEPROM with EEPROM.put() and then get the value, but it doesn't work and I get a blank value when I do a EEPROM.get().
I remember this is how it worked on arduino nano, but now I am trying with an ESP32 board, do they work different ?
#include <EEPROM.h>
char my_string[8];
void setup() {
Serial.begin(115200);
// I am writing by this code, then comment it out to try to read from EEPROM
/*
my_string[0] = 'S';
my_string[1] = 'N';
my_string[2] = '-';
my_string[3] = 'A';
my_string[4] = 'B';
my_string[5] = 'C';
my_string[6] = 'D';
EEPROM.put(0, my_string);
*/
EEPROM.get(0, my_string);
Serial.println("data is: ");
Serial.println((char*)my_string);
}
void loop() { }