Go Down

Topic: MENWIZ: yet another character lcd menu wizard library (Read 78 times) previous topic - next topic

Qdeathstar

#495
Sep 14, 2014, 01:08 am Last Edit: Sep 14, 2014, 02:00 am by Qdeathstar Reason: 1
I wanted to update you and say that i got it to do what i wanted it to do (yay)

basically,

if (button is pushed) {
   menu.actNavButtons(MW_BTL);
  }

then move the actNavButtons() function from private to public.

Works since i'm only using the four navigation buttons(up, down, confirm and exit), and not left.



Seems like an easier way to get custom buttons to work too, maybe not as efficient?   Also, what is the benefit in making some things public and some things private? Is it just so that variables don't end up with the same name? (eg, x in the sketch does one thing, and x in the private section of the library does another?)

EDIT: 

I do have another problem/issue though

It seems like if the "menu" times out, it "saves" it's spot, eg if your a submenu it will return to the submenu.

I'd rather return to the index. Is this possible?

Qdeathstar

So, i've made a lot of progress on my project, but i ran into an issue with the menu library.

What i want to do, is have the menu store an integer in a variable, and then later read the variable and decide what to do based on the variable.

Code: [Select]

r=menu.addMenu(MW_ROOT,NULL,F("Make Selection"));
  s1=menu.addMenu(MW_VAR,r,F("Stop Selected Zone"));
  s1->addVar(MW_ACTION,zoneOff);
  s1=menu.addMenu(MW_SUBMENU,r,F("Solid Colors"));
  s2=menu.addMenu(MW_VAR,s1,F("White")); //will call function 'White' if that menu selection is made.
  s2->addVar(MW_AUTO_INT,&chosenFunction,0,0,0);
  s2->addVar(MW_ACTION,zoneOn);
  s2=menu.addMenu(MW_VAR,s1,F("Red")); //will call function 'White' if that menu selection is made.
  s2->addVar(MW_AUTO_INT,&chosenFunction,1,1,0);
  s2->addVar(MW_ACTION,zoneOn);
  s2=menu.addMenu(MW_VAR,s1,F("Green")); //will call function 'White' if that menu selection is made.
  s2->addVar(MW_AUTO_INT,&chosenFunction,2,2,0);
  s2->addVar(MW_ACTION,zoneOn);
  s2=menu.addMenu(MW_VAR,s1,F("Blue")); //will call function 'White' if that menu selection is made.
  s2->addVar(MW_AUTO_INT,&chosenFunction,3,3,0);
  s2->addVar(MW_ACTION,zoneOn);
 


s2=menu.addMenu(MW_VAR,s1,F("Blue")); //will call function 'White' if that menu selection is made.
  s2->addVar(MW_AUTO_INT,&chosenFunction,3,3,0);


What i want this to do is when i select "Blue", chosenFunction has a value of "3", however, it seems like it returns zero. Serial.print(chosenFunction); prints 0.


I was having difficulty understanding what you meant by, min, max, and increment?  I assume that if the min is 3, and the max is 3, the only value it can be is 3.

Go Up