neu-rah / ArduinoMenu

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

Select betwen 300 items #332

Open PeterWay1 opened 3 years ago

PeterWay1 commented 3 years ago

Hello, Tnx for great work.

I try to use this menu system in my aplication. Everthing is ok... But now i try to use larhe amount of items. I have array like this "bread ..." " meat ... " etc... At end i have 300 items.

Is possible to use this menus for selection betwèn 300 items? Any example for this?

At first i like just simulate then i will add this items on Sd card.

I have 3 button keyboard, arduino with atmega128 and st7735 display.

Have a nice day.. Gregor

neu-rah commented 3 years ago

Hi!

yes, it can be made so, please look at this example https://github.com/neu-rah/ArduinoMenu/tree/master/examples/targetSel

a menu with customized print function that given and index (by the menu system) will print from an array of items (or something else)

PeterWay1 commented 3 years ago

Tnx for help... this example is to latrge... i need only simple example---

Like this: CHOOSE(target.chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle ,VALUE("First",First,doNothing,noEvent) ,VALUE("Second",Second,doNothing,noEvent) ,VALUE("Third",Third,doNothing,noEvent) ,VALUE("Last",Last,doNothing,noEvent) );

Is possible to use variable for name? CHOOSE(target.chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle ,VALUE(var1,1,doNothing,noEvent) ,VALUE(var2,2,doNothing,noEvent) ,VALUE(var3,3,doNothing,noEvent) ,VALUE(var4,4,doNothing,noEvent) );

Tnx Greg

neu-rah commented 3 years ago

what mcu are you using?

PeterWay1 commented 3 years ago

I use atmega128 ( with arduino support) Or atme328 or 256.. Br Greg

V pet., 27. nov. 2020 22:38 je oseba Rui Azevedo notifications@github.com napisala:

what mcu are you using?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/neu-rah/ArduinoMenu/issues/332#issuecomment-734995260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJLMZT4VWQPQONRFC4IRTDTSSAL63ANCNFSM4UEUUJ5Q .

neu-rah commented 3 years ago

the atmega has not much memory, and by default it will use flash (so things get more complicated to access flash memory). The custom menu is the best way to conserve memory. Transposing all those items to populate a menu is a waste, custom menu will print from the array itself.

PeterWay1 commented 3 years ago

Yes, AVR have small RAM and FLASH. I have plane to add SD card (128 MB to 2 GB) and all data heva there.

For first step i need simple example with menus and dynamic items, after this i will try to optimaze code.