Pages: 1 ... 15 16 [17] 18 19 ... 33   Go Down
Author Topic: MENWIZ: yet another character lcd menu wizard library  (Read 71396 times)
0 Members and 1 Guest are viewing this topic.
rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
« Last Edit: December 18, 2012, 06:01:56 am by brunialti » Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Grazie tanto brunialti smiley Now i understand what happened... Thank you for explaining the MW_LIST_3COLUMNS.... Your library is top of the most on menu making...
Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

enjoy
Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.

« Last Edit: December 18, 2012, 06:04:36 am by brunialti » Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: December 18, 2012, 09:48:28 am by Khalid » Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: December 18, 2012, 12:49:26 pm by brunialti » Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice bruniatli...
Should we download from the GITHUB or you kindly attach the patched library here?
Regards
Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In github there are only the "stable" realeases.
Please find here attached the library to test

* MENWIZ.zip (9.22 KB - downloaded 13 times.)
« Last Edit: December 18, 2012, 03:14:33 pm by brunialti » Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank You, i shall test it soon and let you know. Meanwhile, please correct the comment in MENWIZ.h:
Code:
//#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.
« Last Edit: December 18, 2012, 05:19:38 pm by Khalid » Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: December 18, 2012, 05:38:06 pm by brunialti » Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//#include <LCD.h>
//#include <buttons.h>
Only following libraries are required with custom button navigation:
Code:
#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>
« Last Edit: December 19, 2012, 02:52:10 am by Khalid » Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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".
Logged

Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* can we have.JPG (18.01 KB, 688x177 - viewed 29 times.)
Logged


rome
Offline Offline
Sr. Member
****
Karma: 17
Posts: 482
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Next version  smiley
As behaviour of the MW_ROOT _menu
Logged

Pages: 1 ... 15 16 [17] 18 19 ... 33   Go Up
Jump to: