Remember EEPROM on the ESP32 has been deprecated. It has been deprecated for 2 ESP32 core updates. You may find that the API may be now incompatible with EEPROM at some point, and you may run into issues.
Hi.
I had a go at the documentation, and some examples.
I found them a little confusing.
For example, take look at the code below.
It is very simple and easy to understand.
I was not able to convert it to 'Preferences'.
Maybe because the terminology does not reflect the task.
But, definitely, i lack the experience in C++.
I do accept any help though.
the example "Preferences / StartCounter" in the IDE is a very short example how to "write" (put) and "read" (get) a variable from your preference storage.
You should really give it a try.
if you want to provide a short compileable example with meaningful variable names, one could give you an example with preferences.
But honestly - I don't think you will need that - start with the example "Preferences / StartCounter" and the documentation and you will get lucky.