Go Down

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

brunialti

#240
Dec 17, 2012, 12:45 pm Last Edit: Dec 18, 2012, 12:01 pm by brunialti Reason: 1
About option MW_LIST_3COLUMNS. It works correctly. This option is usefull, for instance, when you want select a value within a predefined list (e.g. serial speed). Of course the label lengths must be  congruent with the display width (3 colums means that label's length should be no longer than screenwidth/3-1), otherwise they are trimmed.
If you have more than 5 option you have also to set the MAX_OPTXMENU in MENWIZ.h as explained in the manual.
If options are more than the value of MAX_OPTXMENU the exceeeding ones  are ignored (you can check it with the MENWIZ error function)

Khalid

Grazie tanto brunialti :) Now i understand what happened... Thank you for explaining the MW_LIST_3COLUMNS.... Your library is top of the most on menu making...
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)


Khalid

Salute Brunialti,
Is it possible when we Confirm  LOAD EEPROM or SAVE EEPROM, then after saving/loading the variable parameters, we have a screen appears on the LCD for short duration which shows  VARIABLE SAVE TO EEPROM message. This will ensure us that the variable saved and we no need to press the button again and again.

LCD screen:
---------------------------------
--------------------------------
*********Variable Saved********
--------------------------------

Regards
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

#244
Dec 18, 2012, 09:56 am Last Edit: Dec 18, 2012, 12:04 pm by brunialti Reason: 1
A library is a general purpose function collection and therefore it should'nt  hold application logics.
Neverthless your requirement can be satisfied at sketch level in many simple ways, as, for instance, following (not tested):

Code: [Select]
void savevar(){
 lcd.setCursor(0,1);
 menu.writeEeprom();
 lcd.println("DONE.               ");
 delay(1000);
 }


Usually the use of delay function is discouraged as it halts the program, not allowing button checks and so on. But it can be carefully done sometimes.


Khalid

#245
Dec 18, 2012, 03:03 pm Last Edit: Dec 18, 2012, 03:48 pm by Khalid Reason: 1
Actually i was unaware how can i use LCD commands with your Menu. Thank you for example sketch..Sometime animation make your presentation great so i made a small  working sketch...:
Code: [Select]
void loadvar(){
lcd.clear();
  lcd.setCursor(6, 1);
   menu.readEeprom();
  lcd.print("LOADING");
  for (int i=0; i <= 6; i++)
  {
    delay(100);
    lcd.setCursor(i+6, 2);
    lcd.write(223);
  }
  lcd.setCursor(7, 3);
  lcd.print("Done");
  delay(1000); 
  }


I am not a programmer, so please forgive me if i am asking too much.
Regards
EDIT:
The sketch is tested
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

#246
Dec 18, 2012, 06:40 pm Last Edit: Dec 18, 2012, 06:49 pm by brunialti Reason: 1
I modified the library in order to let users using custom input devices not to include buttons library. It saves about 1.2kbyte.
Resuming the actions to spare space:

1.5 kByte if you do not use sprintf function in your sketch code
1.2 kByte if you disable internal buttons support
0,9 kByte if you disable EEPROM support

to disable EEPROM or button support you must simply comment the #define in MENWIZ.h

I did not test the button disabling yet. Some of you, braves, using custom devices is available to test it? Let me know...

Khalid

Nice bruniatli...
Should we download from the GITHUB or you kindly attach the patched library here?
Regards
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

#248
Dec 18, 2012, 09:10 pm Last Edit: Dec 18, 2012, 09:14 pm by brunialti Reason: 1
In github there are only the "stable" realeases.
Please find here attached the library to test

Khalid

#249
Dec 18, 2012, 11:16 pm Last Edit: Dec 18, 2012, 11:19 pm by Khalid Reason: 1
Thank You, i shall test it soon and let you know. Meanwhile, please correct the comment in MENWIZ.h:
Code: [Select]
//#define BUTTON_SUPPORT     //uncomment if you want to use the readEeprom and writeEeprom methods!

Also i am not using any one wire or Serial devices , should i also comment WIRE.h .
Your kind guidance required.
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

#250
Dec 18, 2012, 11:35 pm Last Edit: Dec 18, 2012, 11:38 pm by brunialti Reason: 1
wire.h is required by LiquidCrystal lib...
In order to test button support you have to

comment the #include buttons.h in the sketch
comment the call to navButtons (if any)
comment the define BUTTON_SUPPORT in MENWIZ.h

Khalid

#251
Dec 19, 2012, 07:49 am Last Edit: Dec 19, 2012, 08:52 am by Khalid Reason: 1
Hi,
Its working fine with custom button... Its good you have added a screen for CONFIRM button for loading and saving to EEPROM.

EDIT:
I have commented following libraries:
Code: [Select]

//#include <LCD.h>
//#include <buttons.h>

Only following libraries are required with custom button navigation:
Code: [Select]
#include <MENWIZ.h>
#include <Wire.h>
#include <EEPROM.h>    // to be included only if defined EEPROM_SUPPORT
#include <LiquidCrystal_SR.h>


Now the custom button work great:) and all characters are good when i commented //#include <LCD.h>
If i comment //#include <Wire.h> then the user screen  one weird character appear..so i un-comment this library...

All seems good..

Recommendation:
Now we can comments following two libraries and save some RAM.
//#include <LCD.h>
//#include <buttons.h>
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

commenting LCD.h should not save any extra space. It should be necessary to keep the include if you want to use lcd within your sketch.
about the confirm request for actions, it is a behaviour (parameter MW_ACTION_CONFIRM) documented in the manual. it should be true by default. It was false by default due to  an "error".

Khalid

brunialti thank you:
My question is can we have a menu number at the top right side of the LCD..Please see picture of Liudr phi LCD.
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

brunialti

Next version  :)
As behaviour of the MW_ROOT _menu

Go Up