Go Down

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

Stafford

I am using MENWIZ in a temperature controller for homebrewing.  I am looking for a work around for updating a binded variable outside of the menu.  From the MENWIZ manual:

"any change the user makes during menu interaction is also available to the sketch code thru the binded variable itself but ,in the current version of MENWIZ, it is not a two way: any variable change done inside the sketch (after addVar declaration) is lost when you access again the menu."

In my case, I have a mode variable that sets the control state of each fermentor to OFF, COOL or HEAT.  I would like to have a single function to turn off temperature control on all fermentors, but this variable can only be updated within the menu. Any ideas how to make this work?

davros

I am using MENWIZ in a temperature controller for homebrewing.  I am looking for a work around for updating a binded variable outside of the menu.  From the MENWIZ manual:

"any change the user makes during menu interaction is also available to the sketch code thru the binded variable itself but ,in the current version of MENWIZ, it is not a two way: any variable change done inside the sketch (after addVar declaration) is lost when you access again the menu."

In my case, I have a mode variable that sets the control state of each fermentor to OFF, COOL or HEAT.  I would like to have a single function to turn off temperature control on all fermentors, but this variable can only be updated within the menu. Any ideas how to make this work?
I'm facing a similar problem. Depending on how you have setup your communication with the fermentor you can actually get the code to change the state (OFF, COOL, HEAT) outside of the MENWIZ menu. The problem is that you cannot get the menu to reflect that change.

For instance, in the code snippet below the menu loads with a default position of PRESET 1. I can change the value of matrixList in my code to get it to run the other items in this menu, but MENWIZ will still show the current position to be PRESET 1.

      p3 = tree.addMenu(MW_VAR, s2, F("MATRIX"));
        p3->addVar(MW_LIST, &matrixList);
        p3->addItem(MW_LIST, F("PRESET 1"));
        p3->addItem(MW_LIST, F("PRESET 2"));
        p3->addItem(MW_LIST, F("PRESET 3"));

I need to be able to change the current position shown in the menu from an external source(serial device). It works easily with the MW_AUTO_INT and MW_AUTO_FLOAT.

backbone

#542
Mar 09, 2016, 06:23 pm Last Edit: Mar 10, 2016, 07:10 am by backbone
Hi,

Old Menwiz user.
I downloaded from github the latest version and used the included libraries on the 1.6.5 IDE.
But the samples included do not compile, I get erros.
Do I use the wrong IDE?
Which one would work?
My old sketches with menwiz are also full of errors during compiling without the skectches ever changed.

I see Bruno has left the office :-(

Paco
Never to old to learn and I learn every day

slamet

Hi backbone...

It is from Roberto regarding your problem as my experience...

In MENWIZ.h

Uncomment the following line:

 

//#define BUTTON_SUPPORT

backbone

Never to old to learn and I learn every day

TonyFait

I am using Menwiz for temperature control.

I would like to be able to reuse the Flashstring used for addList for other feedback to the user, so am creating it and saving it first in a const __FlashStringHelper *variable.  But when I then use the variable in the call to addItem, I get nonsense characters in the menu display.

Here is a snippet of the code:

 
Code: [Select]
r=tree.addMenu(MW_ROOT,NULL,F("Menu"));
   s1=tree.addMenu(MW_SUBMENU,r, F("Configure Vents"));
     s2=tree.addMenu(MW_SUBMENU,s1,F("Choose vent"));
        s2->addVar(MW_LIST,&index);
        const __FlashStringHelper * newString=F("Controller");
        Serial.println(newString);
        s2->addItem(MW_LIST, newString);
        s2->addItem(MW_LIST, F("Vent 1"));


I'm not great at pointers, but it compiles fine, and the call to Serial.print works fine, just not the menu display.  Also subsequent list items turn up weird also on the lcd.

Many thanks!

In Australia. I'm probably asleep while you're waiting for me to reply.

TonyFait

Code: [Select]
r=tree.addMenu(MW_ROOT,NULL,F("Menu"));
   s1=tree.addMenu(MW_SUBMENU,r, F("Configure Vents"));
     s2=tree.addMenu(MW_SUBMENU,s1,F("Choose vent"));
        s2->addVar(MW_LIST,&index);
        



My error is in the third line of the code above.  Using MenWiz's getErrorMessage(true) function after each line, line 4 generated an error 110, which is described in the pdf documentation as "MW_VAR menu type required", and thinking it referred to line 4 was puzzled.  Finally the penny dropped that the previous line needed to be of type MW_VAR instead of MW_SUBMENU.

Using a const __FlashStringHelper pointer variable wasn't the problem at all, that was just my weakness and I supposed that the error must have been there.

Anyway, great library, thanks so much!
In Australia. I'm probably asleep while you're waiting for me to reply.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy