[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

menuMgr RSS feed
Forum Index » tcMenu Arduinio library
Author Message
dsap4004


Joined: Apr 26, 2019
Messages: 21
Offline
I would like to use the menuMgr functions to load and save menu values into the eeprom. I am reading through the documentation and I see something about menuMgr.save(); and menu.Mgr.load() but when I use these in a sketch I get errors related to not passing arguments to the functions. I'm not sure what data type the eeprom object is supposed to be and I'm not sure what is meant by a magic key. According to the documentation passing no arguments means it on menuMgr.save(); it saves all changed items and on menuMgr.load(); it loads all items. Are there any other examples of this being used? I have a way of storing items to eeprom in my full project already but it would be nice to simplify it from the menu manager.
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
Apologies for hitting this, I’ll get the documentation up to date.

The eeprom is an instance of an EepromAbstraction from IoAbstraction, see the two linked examples for usage. The magic number is just an integer that is written on save and then checked on load. It just means it won’t load unless it finds that value.

Please see this example for inbuilt AVR ROM (Uno Mega etc)

https://github.com/davetcc/tcMenuLib/blob/master/examples/ledFlashNoRemote/ledFlashNoRemote.ino

And for i2c rom on 32 bit boards:

https://github.com/davetcc/tcMenuLib/blob/master/examples/takeOverDisplay/takeOverDisplay.ino

Let me know if that helps.

Thanks,
Dave
dsap4004


Joined: Apr 26, 2019
Messages: 21
Offline
This gives me somewhat of an idea of how to implement but I'm still getting the error "'AvrEeprom' does not name a type" when I try to "AvrEeprom eeprom;" in my sketch. When I try the example "take over display" I'm using local eeprom not I2c eeprom so if I uncomment the "AvrEeprom eeprom;" and comment out the I2c version I get "'AvrEeprom' does not name a type" in that sketch as well. Thanks again for your help on this.

Some info that may be pertinent:

I'm using an ESP32 which was working fine with the standard Arduino EEPROM.h library. I think that this processor is non AVR so maybe that's the issue? I'm not sure as the regular Arduino EEPROM.h library is supposed to be AVR as far as I can tell. I get warnings but my EEPROM.h library sketch works and the menu manager sketch does not. Is the solution here just to get an I2c eeprom when working with chips like the ESP8266 or ESP32?
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
As you are not using an 8 bit board. Avr eeprom only works on boards with an avr processor such as Mega and Uno.

If you’re using a 32 bit board such as MKR then the best option is the i2c EEPROM example above. ESP support is still in progress at the moment but if you want me to wrap the inbuilt EPROM in flash library I can do so.
dsap4004


Joined: Apr 26, 2019
Messages: 21
Offline
If that's easy enough and possible to do I would love to know how it's done as the built in arduino EEPROM library works with AVR arduino chips and ESP32. I think espressif knew most built in Arduino libraries would get used and came up with some sort of solution that the compiler understands. Either way, let me know if it's too much trouble or not as I would like to use this solution without having to add more hardware to the project. ESP32 and ESP8266 are quickly becoming some of the more popular solutions because of processor power, price and size as compared to Arduino, even on projects not utilizing WiFi.
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
Agreed, I’ve been working on major improvements for ESP8266 support in the next release. I’m looking at ESP32 as well. I’m having a few problems with ESP8266 at the moment on master.

I’ll add the ESP eeprom support in a release soon.

See https://github.com/davetcc/IoAbstraction/issues/52
dsap4004


Joined: Apr 26, 2019
Messages: 21
Offline
Nice! Sounds like progress. I'll be on the lookout. Until then I may just handle read and write events to eeprom myself as I'm not comfortable modifying libraries yet. Thanks again. smilie
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
The EEPROM is now wrapped in 1.3.1. See the ESP8266 example that is now packaged in the examples.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.