8 years, 4 months ago.

Breaking out of the menu system

Hello. i would like to use them for controlling hardware with a menu system. I do not know how to break out of the the " lcd128menu() function once it is called. any suggestions? I am a novice and have been studying arrays, pointers etc. i have done some testing and concluded that once this function is called it monitors the joystick to enable selection through the menus. I would like to be able to let the user go through the menu and select options using the "fire" button on the joystick.

Thank you.

Question relating to:

Sample usage of lightweight C12832 LCD library application board, C12832, LCD

Sorry for not answering i was away from mbed =)))) a lot of time =) looks like you found solution already, may be i will finish this library - its alpha state now but fell free to change it in any way you like

posted by Alexander Medvedev 11 Mar 2016

1 Answer

8 years, 4 months ago.

I think you can get what you want if you change lcd128menu.cpp.

https://developer.mbed.org/users/medvdv/code/lcd128lib/file/5cd32671a837/lcd128menu.cpp

Add this at line 99 if (fire) return (menuCurrent + item)->id;

If I'm reading the code right it should then return the id value of the menu item that was selected.

Accepted Answer

Thank you. i will try it and let you know how i go.

posted by Michael Sammut 15 Dec 2015

Just tried it. Works great. Much appreciated. Now I can go ahead and see if I can manipulate other features of this coding. Thanks again Andy.

Michael.

posted by Michael Sammut 15 Dec 2015