Go Down

Topic: MENWIZ: yet another character lcd menu wizard library (Read 85761 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.

k4ktus

somebody who is running the lib under avr studio 6?
my blog and projects:
http://simons-holzvergaser.blogspot.com/

k4ktus

That's why I'm asking:

Code: [Select]
Error 34 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 376 5 CtrlHV_Q_D1
Error 35 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 376 5 CtrlHV_Q_D1
Error 36 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 376 5 CtrlHV_Q_D1
Error 37 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 376 5 CtrlHV_Q_D1
Error 39 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 379 5 CtrlHV_Q_D1
Error 40 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 379 5 CtrlHV_Q_D1
Error 41 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 379 5 CtrlHV_Q_D1
Error 42 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 379 5 CtrlHV_Q_D1
Error 44 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 403 28 CtrlHV_Q_D1
Error 45 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 403 28 CtrlHV_Q_D1
Error 46 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 403 22 CtrlHV_Q_D1
Error 47 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 403 22 CtrlHV_Q_D1
Error 48 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 445 6 CtrlHV_Q_D1
Error 49 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 445 6 CtrlHV_Q_D1
Error 50 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 445 6 CtrlHV_Q_D1
Error 51 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 445 6 CtrlHV_Q_D1
Error 53 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 452 4 CtrlHV_Q_D1
Error 54 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 452 4 CtrlHV_Q_D1
Error 55 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 452 4 CtrlHV_Q_D1
Error 56 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 452 4 CtrlHV_Q_D1
Error 61 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 496 19 CtrlHV_Q_D1
Error 62 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 496 19 CtrlHV_Q_D1
Error 63 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 496 19 CtrlHV_Q_D1
Error 64 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 496 19 CtrlHV_Q_D1
Error 75 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 567 3 CtrlHV_Q_D1
Error 76 ISO C++ forbids declaration of 'type name' with no type [-fpermissive] E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 567 3 CtrlHV_Q_D1
Error 77 expected primary-expression before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 567 3 CtrlHV_Q_D1
Error 78 expected ')' before 'const' E:\Projekte\Atmel Studio\CtrlHV_Q_D1\CtrlHV_Q_D1\Lib\MENWIZ\MENWIZ.cpp 567 3 CtrlHV_Q_D1
my blog and projects:
http://simons-holzvergaser.blogspot.com/

k4ktus

looks like that there was a change in pgmspace.h. Becaus the lib is also not running with newer ide
my blog and projects:
http://simons-holzvergaser.blogspot.com/

inshuno

Hi
can someone explain me why this is not working.

// 1.0
   s1=menu.addMenu(MW_SUBMENU,r, F("Adr Menu"));
   s1->setBehaviour(MW_MENU_COLLAPSED,false);

// 1.1    
    s2=menu.addMenu(MW_VAR,s1, F("Address 1"));        
       s2->addVar(MW_AUTO_INT,&address1,0,255,1);
         s3->addVar(MW_ACTION,test1);
         
// 1.2    
    s2=menu.addMenu(MW_VAR,s1, F("Address 2"));        
       s2->addVar(MW_AUTO_INT,&address2,0,255,1);
         s3->addVar(MW_ACTION,test1);

Instead of incrementing or decrementing the variables Address 1 or 2 the Menu jumps directly to the MW_ACTION part. It also does not work with any other MW_AUTO_xxx.
Is this a Bug or what else? Would be fine to get it running as a Xmas present.
Thanx for some help

Go Up