Go Down

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

djrm

Hello,
I understand the memory concern of keeping a buffer to compare past and new screens I had to use a mega 256 for the previous project to gain extra memory, and yes, i2c always seems to be the slowest option although hugely convenient. Fortunately now I understand the reason for the delay a simple solution will be to limit the update rate of the display to give the PID calculation more time to execute. I may even hive off the display to a low priority function triggered by a timer and a flag set by the user function.
Best regards, David.

waski

Hello to everyone !

I've got everything working - tank you brunialti ! :)
But here comes another question  - I need a two way "communication" for few variables : user can change them using buttons or remotely, using serial connection and they have to be "visible" on LCD and serial at the same time. But I know MENWIZ doesn't support this. Is there any solution for this ?

lostboysoft

Hello, I came from spain , thank you for your library brunialti, it's very complete and usefull ;)

I have a problem with the library... I use a menu with a lot of options and sometimes the options its no apears (the menu_index indicates "256/5" as the list is 256 elements but no appearns none. Can you help me?

The lines of code for create menu in the setup() are here:

void setup(){
  _menu *r,*s1,*s2;

  Serial.begin(115200);   
 
  Serial.println(sizeof(menwiz));
  tree.begin(&lcd,20,4); //declare lcd object and screen size to menwiz lib

  r=tree.addMenu(MW_ROOT,NULL,F("Settings"));
    s1=tree.addMenu(MW_SUBMENU,r,F("Cargas HB"));        //add a child (submenu) node to the root menu
      s2=tree.addMenu(MW_VAR,s1,F("HB D10"));
        s2->addVar(MW_LIST,&listb1);                          //create a variable of type "option list"..
        s2->addItem(MW_VAR,F("HB 10/3000"));
        s2->addItem(MW_LIST,F("HB 10/1500"));
        s2->addItem(MW_LIST,F("HB 10/1000"));
        s2->addItem(MW_LIST,F("HB 10/500"));
        s2->addItem(MW_LIST,F("HB 10/250"));
        s2->addItem(MW_LIST,F("HB 10/100"));

  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);

      s2=tree.addMenu(MW_VAR,s1,F("HB D5"));
        s2->addVar(MW_LIST,&listb2);                          //create a variable of type "option list"..
        s2->addItem(MW_LIST,F("HB 5/750"));
        s2->addItem(MW_LIST,F("HB 5/250"));
        s2->addItem(MW_LIST, F("HB 5/125"));
        s2->addItem(MW_LIST,F("HB 5/62.5"));
        s2->addItem(MW_LIST,F("HB 5/25"));
 
  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);
 
    s2=tree.addMenu(MW_VAR,s1,F("HB D2.5"));
      s2->addVar(MW_LIST,&listb3);                          //create a variable of type "option list"..       
      s2->addItem(MW_LIST,F("HB 2.5/187.5"));
      s2->addItem(MW_LIST,F("HB 2.5/62.5"));
      s2->addItem(MW_LIST,F("HB 2.5/31.25"));
      s2->addItem(MW_LIST,F("HB 2.5/15.625"));
      s2->addItem(MW_LIST,F("HB 2.5/6.25"));

  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);


    s2=tree.addMenu(MW_VAR,s1,F("HB D1"));
      s2->addVar(MW_LIST,&listb4);                          //create a variable of type "option list"..       
      s2->addItem(MW_LIST,F("HB 1/30"));
      s2->addItem(MW_LIST,F("HB 1/10"));
      s2->addItem(MW_LIST,F("HB 1/5"));
      s2->addItem(MW_LIST,F("HB 1/2.5"));
      s2->addItem(MW_LIST,F("HB 1/1"));
 
  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);
 
    s1=tree.addMenu(MW_VAR,r, F("Cargas HV"));
      s1->addVar(MW_LIST,&listv);                          //create a variable of type "option list"..
      s1->addItem(MW_LIST,F("HV125"));         
      s1->addItem(MW_LIST,F("HV100"));         
      s1->addItem(MW_LIST,F("HV50"));         
      s1->addItem(MW_LIST,F("HV30"));         
      s1->addItem(MW_LIST,F("HV20"));         
      s1->addItem(MW_LIST,F("HV10"));         
      s1->addItem(MW_LIST,F("HV5"));         
      s1->addItem(MW_LIST,F("HV3"));         
      s1->addItem(MW_LIST,F("HV2"));         
      s1->addItem(MW_LIST,F("HV1"));         
 
  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);
 
      s1=tree.addMenu(MW_VAR,r,F("Zooms"));            //add a terminal node (that is "variable");   
        s1->addVar(MW_LIST,&listz);                          //create a variable of type "option list"..
        s1->addItem(MW_LIST,F("140x"));         
        s1->addItem(MW_LIST,F("70x"));         
        s1->addItem(MW_LIST,F("44x"));         
        s1->addItem(MW_LIST,F("40x"));         
        s1->addItem(MW_LIST,F("20x"));         
        s1->addItem(MW_LIST,F("14x"));         
 
  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);
 
      s1=tree.addMenu(MW_VAR,r,F("Reads"));            //add a terminal node (that is "variable");
        s1->addVar(MW_LIST,&listl);                          //create a variable of type "option list"..
        s1->addItem(MW_LIST,F("One reads"));         
        s1->addItem(MW_LIST,F("Two reads"));         

  Serial.println(mem);
  mem=tree.freeRam();
  tree.getErrorMessage(true);
 
tree.navButtons(UP_BOTTON_PIN,DOWN_BOTTON_PIN,LEFT_BOTTON_PIN,RIGHT_BOTTON_PIN,ESCAPE_BOTTON_PIN,CONFIRM_BOTTON_PIN);
  }



I use the last MENWIZ (1.2)

Sorry for my bad english...  :smiley-roll-sweat:

lostboysoft

Now It's Ok. My Mistake was on inicialcing variables... if the variable of the MW_LIST is not 0 not appear nothing in the menu...

By the way ... for the error 132 which gives me sometimes referred getErrorMessage?

Thanks ;)

Bryanpl

All:

Wonder if anyone is having issues with using MenWiz and Timer1. The following code in the setup routine chokes MenWiz and the LCD will not display anything.

Code: [Select]
// initialize Timer1
cli();          // disable global interrupts
TCCR1A = 0;     // set entire TCCR1A register to 0
TCCR1B = 0;     // same for TCCR1B

// set compare match register to desired timer count:
OCR1A =  arrayRPM[rpm]; //t_output;
// turn on CTC mode:
TCCR1B |= (1 << WGM12);
// Set CS10 and CS12 bits for 1024 prescaler:
TCCR1B |= (1 << CS10);
TCCR1B |= (1 << CS11);
// enable timer compare interrupt:
TIMSK1 |= (1 << OCIE1A);
// enable global interrupts:
sei();

-=Bryan=-

Go Up