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!!!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login