jonblack / arduino-menusystem

Arduino library for implementing a menu system
MIT License
194 stars 85 forks source link

Update menu value at initialization #43

Closed RobiGoBH closed 7 years ago

RobiGoBH commented 7 years ago

I have the following logic:

I have a #include "SaveLoadSettings.h" to save and load setting from SD card I have a #include "BLMenu.h" to declare the menu structure.

In Setup() I call first the loadSetting() after that I do the

ms.get_root_menu().add_menu(&mu_mm_set);
    mu_mm_set.add_menu(&mu_mm_l1_timers);
      mu_mm_l1_timers.add_item(&mi_set_load_int); 
....

to create the menusystem. Now I have the in the memory loadInt=9 what is the loaded value of the variable, but in the menu showing 10 what is the default value of the variable. How can I update that? Or how I can create the menu itself to have the right values (the loaded in values) by default? The only way what I can imagine to walk thru the menu structure and update the values if any of them different from the default, but that is not very elegant solution....

Thanks

jonblack commented 7 years ago

Sorry for the late reply. This is a duplicate of #25.