Hello Dave!
Thanks a lot for this wonderful library, it made me experience the ioAbstraction lib too which is really useful.
May i give you some feedback and come at the end to my major roadblock:
I use TCMenu builder on OS X and the lib on Arduino Due (latest version for everything)
Hardware: Arduino Due, I2C 478x based 4x20 display, 5x4 matrix keypad
1. I found out TCMenu is crashing when you put in Divisor = 0.
2. Is there a possible way to detect if a value edit is complete? Right now i just get back every change, but did not find out how to detect if the edit is finished. Especially with keypad its a little bit cumbersome
3. I did integrate the keypad quite well (Ent = * and Esc = # and the up down keys for nvigation). Whats the best way to use the by tcmenu unused keys (like F1, F2, # , *) to trigger some actions?
#include <tcMenuKeyboard.h>
const char KEYBOARD_STD_5X4_KEYS[] PROGMEM = "WXYZ123A456B789#L0R*";
KeyboardLayout keyLayout(5, 4, KEYBOARD_STD_5X4_KEYS);
MatrixKeyboardManager keyboard;
MenuEditingKeyListener menuKeyListener;
4. Just a luxury question
Is there a way to use the left/right arrow keys for navigating inside a edit field?
5. FYI IoAbstraction/TCmenu is not compatible with the Bouncer2 lib, if you have included this one too you get some wired behavior. I just encountered it when changing from Bouncer2 to your lib, so no real problem.
So, finally lets come to my roadblock:
I have a Menu wit Submenus, Analog, Action and EEnum working. Im getting the callbacks, it looks quite ok.
I can save the TCMenu settings to EEprom (i2C) wit menuMgr.save(eeprom). It works as expected.
But ... when i load the eeprom (no matter if i do it right after setupMenu() or later, TCMenu crashes the Due when accessing any menu where values are displayed. I can navigate the root menu but as soon as i go into a populated submenu or i select an ActionItem it stops the Arduino.
To experiment with that a little i did my own loader which takes the values from the EEprom and writes it into the TCMenu values
// its just one of the load commands, done for all values
stepmm = eeprom.read16(42);
menuSettingsSetupStepper1mm.setCurrentValue(stepmm);
It seemed to work first but then it crashed again.
So i added just another second load for just 1 menuitem at the end of void setup(), which made it work again:
menuFlexWeight.setCurrentValue(eeval);
But it looks just like a happy accident, because when i change things in TCMenu generator and compile it again it crashes or it runs, with no pattern i can see.
As example, i added one more menu item, it works.
Then i added the callback function without code in it, still works.
Then i add the code and tcmenu crashes wherever i go (not only on this new item). It runs if i didnt load the eeprom values!
void CALLBACK_FUNCTION onFlexPresetChange(int id) {
/*
int swap;
swap = menuFlexPreset.getCurrentValue();
sermsg( 2, 0, "TEST: flex mode change: ", swap);
*/
}
The commented version above runs, if i uncomment it it makes tcmenu crash.
Btw. i did initialize the eeprom with 0 values and then a eeprom write via menuMgr.save, so the values from TCmenu look ok and i dont assume any problem from this side. Reading and writing to the eeprom also works like expected, so no I2C related problem.
It would be great if you can help me, i was hacking around the problem the whole weekend without managing to trace down the problem.
Tom