Menu on LCD: strings, multi-dimensional arrays?


hey guys.  i've searched around bit before posting, wasn't sure for, forgive me if has been answered.

what i'm looking accomplish following:

have series of user-navigable menus drawn using liquidcrystal library.

i've come pseudo-code want do, it's long enough i'll try , summarize have in mind.

i'd have:

  • int corresponding "menu" user in.
  • int corresponding selected "item" in menu
  • bool corresponding whether "editing" item's "value"
  • array of names of "menu"s written screen user (id corresponds menu int.)
  • array of names of "items" in each menu (again id's match "selected item" int)
  • array of values each "item" in each "menu"  


i'd ideally build in such way when i'm drawing menu can use these variables plugged same function no matter menu structure looks like.  this way, if need add items menu later it's no big deal -- adjust lengths of arrays , that's it.

so here questions have:

  • what's best way structure this?  i'm thinking of 2- or 3-dimensional array, starts complex when try , think how link values of items names.  another thought create new class handles of data stuff, don't know c enough know if that's approach.
  • what's best way handle large number of strings i'll needing keep track of?  if makes easier, know they'll less length, , can pad them out same length whitespace.
  • values of menu items in variety of formats, including list of text-based options correspond numeric values.  (one example being string "1/8000" represent int 125)
  • there better way doing this?  i don't have *real* formal training in cs, i'm sure there better ways this.


(in opinion) think "linked lists" way of doing menus.

there section in book "c: complete reference" (great book)

i found @ http://cslibrary.stanford.edu/103/linkedlistbasics.pdf.  basically, use "next"/"previous" approach, , have found successful way use xml data.  the trick add pointer called "parent"; go through list , print every element parent.

there library out there somewhere if keep digging around.

if have lots of strings, best progmem


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Menu on LCD: strings, multi-dimensional arrays?


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums