neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
948 stars 191 forks source link

Limit the number of items in the menu #367

Closed Astar76 closed 3 years ago

Astar76 commented 3 years ago

Is there a limit in the library for the number of menu items used? I have an ESP-32 microcontroller and the menu already has many items. But when adding a new TOGGLE element, I get an error, but not at the compilation stage, namely when you enter the menu section. It seems to me that this is due to the limitation on the number of elements. Here's an example TOGGLE:

// todo добавить сохранение
TOGGLE(pixelsValue, pixels, "Pixels: ", doNothing, noEvent, noStyle,
    VALUE("1", 1, doNothing, noEvent),
    VALUE("2", 2, doNothing, noEvent),
    VALUE("3", 3, doNothing, noEvent),
    VALUE("4", 4, doNothing, noEvent),
    VALUE("6", 6, doNothing, noEvent),
    VALUE("8", 8, doNothing, noEvent),
    VALUE("12", 12, doNothing, noEvent),
    VALUE("16", 16, doNothing, noEvent),
    VALUE("24", 24, doNothing, noEvent),
    VALUE("32", 32, doNothing, noEvent),
    VALUE("48", 48, doNothing, noEvent),
    VALUE("96", 96, doNothing, noEvent)
);
hicksan commented 3 years ago

Quoting neu-rah from another issue: "yes, there is a limit on the number of items, they can be 127 on AVR mcu's and 32767 on non AVR's." A toggle should be a two-way choice really, so there may be some problem with the number of options you are toggling between. This looks more like a case for SELECT or CHOOSE menu items to me. Trying that may fix your problem.

Astar76 commented 3 years ago

Спасибо за ответ