Saving and reusing variables?
-
Hi, i've seen the new block in the beta (EEPROM) and I was wondering how can I save the data of the variables so I can use it after rebooting the M5.
Example: the score of a game, save it so the next time you turn off and on the device the score is still there -
Are you talking about NVS (Non Volatile Storage?)
M5ez uses it for its preferences. Here is a file that reads and writes them in C: https://github.com/vkichline/M5ezSettingsStorage/blob/master/m5ez_prefs_storage.cppBasically, just include preferences.h, call prefs.begin with false for read/write, then use the accessors from preferences.h and finish with prefs.end().
-
@vkichline thank youuuu
-
-
How many write operations are maximal at the EPROM possible?
-
@gaviota said in Saving and reusing variables?:
How many write operations are maximal at the EPROM possible?
I was wondering the same thing. This source and in more detail this source say the typical is 100,000 write/erase cycles.
I'm also wondering which address location uiFlow uses to store the key/value data to EEPROM. @m5stack or @lukasmaximus do you know?
-
@world101 thank you a lot!!!