Ah I see, apologies there I misunderstood the question.
The best example to look at is simpleU8g2, it is pretty much the minimum code to start a menu and also load and save from eeprom.
https://github.com/davetcc/tcMenuLib/blob/master/examples/simpleU8g2/simpleU8g2.ino
In summary from the above linked sketch:
Function setup() has the calls needed to both initialise the EEPROM and to load the values back. Or for clarity BEFORE calling setupMenu() you should:
EEPROM.begin(512); // prepare ESP rom for 512 bytes
menuMgr.setEepromRef(&arduinoEeprom); // set it on menu manager
After calling setupMenu you would then load values back.
menuMgr.load();
Function onSaveSettings() has the code needed to save to the rom. Or to be clear:
menuMgr.save();
EEPROM.commit();
Hello Dave,
I have an ESP32 (heltek) , and I tried to integrate your solution to save to eeprom.
But some declarations needed, do you know that I have to include?
C:\Users\martal\Desktop\esp32_oled\test_menu\tcmenu\tcmenu.ino: In function 'void setup()':
tcmenu:72:5: error: 'EEPROM' was not declared in this scope
EEPROM.begin(512); // prepare ESP rom for 512 bytes
^
tcmenu:73:27: error: 'arduinoEeprom' was not declared in this scope
menuMgr.setEepromRef(&arduinoEeprom); // set it on menu manager
^
C:\Users\martal\Desktop\esp32_oled\test_menu\tcmenu\tcmenu.ino: In function 'void onSaveSettings(int)':
tcmenu:141:5: error: 'EEPROM' was not declared in this scope
EEPROM.commit();
In the example you have mentionned (https://github.com/davetcc/tcMenuLib/blob/master/e...ples/simpleU8g2/simpleU8g2.ino)
I haven't found any other declaration.
And what about type of &arduinoEeprom?
Thanks