Pages: 1 ... 10 11 [12] 13 14 ... 32   Go Down
Author Topic: MENWIZ: yet another character lcd menu wizard library  (Read 58774 times)
0 Members and 1 Guest are viewing this topic.
rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm happy it works. It was in my goals to write a library simple to use and hackable.
And now let me try to hel paco :-)


p.s. please send to me the modified files and sketch. I want let it available on github
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have a question about the input-modes (variables). I want  to use the menu to input a time variable to set my ds1307. As it uses unix-time it should not be a problem in general. The only problem is, that I want the user to see hours and minutes while setting the time instead of the seconds unix time uses. I dont need year, month and day.

Thank you for any suggestions!!
calim
Logged

~~User of the mighty Arduino Nano v3.0~~

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MENWIZ still does'nt support edit mode (that is value inpt using some keybord).
It is a feature that I should implement but I cannot say when.
At this moment you can build a menu enty labelled "Time set" and three variable inside labelled "Hour" (type byte, increment 1, values 0-24),"Minutes" (type byte, increment 1, values 0-60), "Set" (action type).
In the first two variables you can set the values and the third can call a user defined action making the proper conversions and setting the RTC.
In the next release a new behavior will be available (collapsed_view), allowing to see variable values on the same label line . This will provide a better way to implement such menus.
You should be able to create a screen like the following

Code:
TIME SET MENU
- Hour    :11
- Minutes :23
->Set
« Last Edit: September 04, 2012, 11:10:51 am by brunialti » Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you, I thought so, too. Of course it woud have been great to have some menu displaying "hh:mm" and to set first "hh", press confirm and then "mm" and press confirm.

Could it be there is a menu-limit in MENWIZ? My main menu only displays three submenus of the four right now and the third is empty.
Of course I not only want to set time but set some alarm-times, too. In fact 12 different times, some other integer variables and some boolean variables. I'm working on a aquarium control unit. :-)

Thanks, calim
Logged

~~User of the mighty Arduino Nano v3.0~~

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem is the available memory. I do not want to fillup the whole memory implementing variable specific behavihours. We'll see. I'm tempted to set some special variables (as time, password ans so on).
The menu dimensions can be set by the user. Of course you must be warned about memory consumption.
Please read the chapter "Internal variables and memory limits" of the guide.

Should I have more time I would port the lib to graphical display. It should not be too difficult: the rendering is confined in a small part of code, under not more than 5-6 functions, logic and the data structures are the same. I need to find a library similar to liquidCrystal for graphical display.

I'm interested in your aquarium project. Let me know the main characteristics.
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I already tried to set up another the MAX_MENU-variable in the scetch instead of the MENWIZ.h. So it had no effect.  smiley-roll-blue Now when I change it to 25 it works (but I haven't set up half of the variables I want to change). When I set it to 30 there occur errors in the menu. I hope 25 is enough to set up all menus.
I need menus to set up time, 2x on-times for the light, 2x off-times for the light, moon-light duration, temperature and fan-offsets, CO2 on and off, 2x on and off for the dynamic pump, 2x time and duration for the fertilizer pumps as well as activation variables for some of the options. Seems to be some extensive menu making ahead.  smiley

Thank you for the help!
Logged

~~User of the mighty Arduino Nano v3.0~~

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MAX_MENU is not a variable, is a define. It take effect at compile time not at run time.
Which errors?
check free memory and use getErrorMessage  (it allert you when lib cannot allocate memory).
« Last Edit: September 04, 2012, 04:18:03 pm by brunialti » Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I was sloppy when writing the last post.   smiley-red
When I'm back at my arduino I'll try to get the information about memory and errors. Yesterday I got the error when trying to adjust a integer variable (which was 0 to 180 in steps of 1). When I activated the menu I got huge negative values on the lcd as limits which change (to also huge random numbers) when I try to adjust the value before freezing. I think this is some kind of overflow.
Just a thought, would it be possible to make a recurring menu? I, for example, need 12 times a menu to set time. I could be memory saving to have just one menu to set time and call it from several points of the menu and to use it to set variables depending on the actual menu position. I haven't looked into your library and how you remember the position in the menu. It may well be incompatible with the library.

Thanks, calim
Logged

~~User of the mighty Arduino Nano v3.0~~

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm happy it works. It was in my goals to write a library simple to use and hackable.
And now let me try to hel paco :-)


p.s. please send to me the modified files and sketch. I want let it available on github

Hi, I will send you the modified libs, how do I send them to you? I am new to these message forums and not sure how to send them to you. The zipped files are to big to attach, about 9KB

Question
I have been testing your Test_all_var_types example and all is working well with the exception of getting the current value of the tp selection list. The menu remembers that I last selected list item 4 or 5, but when I try to print it to the serial monitor when the Write To serial  menu item is selected and confirmed, tp aways prints as 0, all the other non list variables like the float, byte, boolean, and int show the last selected value but not the list number selected.

Any ideas what I should do to see the currently selected List item number?

Thanks
Tom
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
MAX_MENU is not a variable, is a define. It take effect at compile time not at run time.
Which errors?
check free memory and use getErrorMessage  (it allert you when lib cannot allocate memory).

I tested the scetch I was working on. With #define MAX_MENU 25 the menu works fine. With #define MAX_MENU 30 I get a error when I go into the last menu I created and try to set the variable. Instead of
Code:
0 [0] 180
there is
Code:
1190 [0] 3597
on the LCD and I get the error code 44. freeRam is 98. When I leave the menu the error code is gone (0), still with freeRam=98 and instead of the menu point to set the variable the point is changed to my root menu name. When I select it I get to the root menu.
Strangely, when I set another variable in another menu branch this works well. However, when I go to the last menu there is the entry of the root menu as described above.

I hope this helps and is not too confusing.

calim
Logged

~~User of the mighty Arduino Nano v3.0~~

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@calim
the freeram value is really low. It could be the source of your problem.
In order to save a little amount of memory, try to disable EEPROM support (comment #define EEPROM_SUPPORT  line in MENWIZ.h)

Logged

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@calim
about recurring menus there are many problems: the label cannot be changed dinamically after declaration (it could be even dangerous as it stored in the prog mem space), even more internally the library stores the pointer to the sketch variable defined by user *and* the last confirmed value (in order to allow the user to cancel unwanted changes) and the eeprom support method stores just one variable for each menu vaiable object.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, thanks for this great lib!

I've got a few questions:

I'm building something like this:

Root
 -> Room 1
     -> P1
     -> P2
 -> Room 2
     -> P1
     -> P2


is it possible to define P1, P2 (which are indeed quite long) strings once and re-use for the different rooms? I guess this would save some PROGMEM space.

Also, I would like to make the number of rooms configurable through a #define, do you think I could add the menu items dynamically within a for loop in setup() ?


Logged

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

about label duplication:
it could be a good idea, and it quite easy to implement in MENWIZ. I do'nt know if the label duplication is really a common practice or not.

about dynamic menu(s) creation:
of course you can create menu entries inside a loop.
« Last Edit: September 07, 2012, 07:37:21 am by brunialti » Logged

rome
Offline Offline
Sr. Member
****
Karma: 15
Posts: 474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@tomega3
The problem of the list index is a (regression) bug of MENWIZ. I solved it and I'll put on gethub asap.
Thanks tom

EDIT the new version 1.0.2 with the above patch is available at

https://github.com/brunialti/MENWIZ/downloads
« Last Edit: September 07, 2012, 11:51:43 am by brunialti » Logged

Pages: 1 ... 10 11 [12] 13 14 ... 32   Go Up
Jump to: