Pages: 1 ... 19 20 [21] 22 23 ... 34   Go Down
Author Topic: MENWIZ: yet another character lcd menu wizard library  (Read 75850 times)
0 Members and 1 Guest are viewing this topic.
Pakistan
Offline Offline
Sr. Member
****
Karma: 6
Posts: 357
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That program was written with old MENWIZ library 1.1 that was supporting the 4 and 6 buttons. The new version of MENWIZ support only 6 buttons so change the lines
Code:
menu.addUsrNav(navMenu,6);
and remove or comment this line:
Code:
MW_navbtn=4;
The rest is variable declaration problem, tempF variable should be global and defined at the top above Setup();
post the total sketch here.
Logged


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

Just a guess .... as I am an absolute beginner ..... it seems a library problem ... do you have all the necessary library included ?


not lib prob got new from terry that one is ok.

but thanks all for showing intrest i relly like this forum  i whill soon be back with probs for you to help me with . joust bought some books on arduino programing  "Practical Arduino Cool Projects for Open Source Hardware and the Beginning Arduino Programming "  hope ther good cu all..

Thanks khalid i saw that one , and it compile's with "menu.addUsrNav(navmeny,4);"    on    1.2Menwiz   1.0.3 ide
« Last Edit: January 04, 2013, 11:27:01 am by Thomas_berg_ » Logged

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

I love when users help each other  smiley
The latest version should support also the 4 buttons via addusrnav (sorry i did not tested myself, so please confirm it).
So guys, which is the feature you would like be implemented next?

p.s. for who implemented a custom device using addusrnav: if you could briefly write a solution description with callback code I would like to insert into manual, in order to help other users!
Logged

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

So here i go again new day new bits to bite  smiley-red

So far i got Menwis1.2 with analog 6button  "yippi 5more digital ports"  and terrys meny build with temp and 3reley.

so to cut to the problem Terry does farenheit me no understand me european haha okey , i have tryed my best to solv this geting 5v to 0-1023 aka 1024 and all of that look't att examples that cover the never ending *5,0 /1024 *100 /10 soooo many diferent combinations even some that devide by 8,0 insted of 10  seems moore than confusing too me  and if that whas not enogh we got some  (average*5000)/1024; going on in the code that i dont get..  soo it's an LM35D that im having a fist fight with wish i could read italian haha , could some handy more whise than me see what im doing wrong   ( i have //out all that has with farenheit to do i hope i did that right and i named ALL temF to tempC i probobly missed some thing temp stays at 10 C anything but the room 25 C  :-)

i think i whill crash into bed now zzZZzZzZ gees 4:30 AM in sweden bye..

code is in attachment  everything but the temp works i think.  sorry if temp probs is not realy this topic but sinns we are modding with Menwin i thought that i kept my problems here while doing menwis..  UPDATED: 6/1/2013 soo i remover the Offset in volts sinns LM35D does NOT go minus centigrade :-) still it moves little fishy but it is in range so if anybody can se obvious fault in code i think i got it.
 UPDATED: i did also tie Vout from lm35D to Ground with a 560Ohm resistor and that seems to make it more acurate not showing 2celcius low :-) is that okey to tie Vout to ground with no -V or Vref :-) :-( hehe Vout on Lm35  2,69 on my FLUKE and display cant relly make its mind upp 26 27 26 27 close enogh fore me.  room temp 27C

And thanks to  Brunialti Terry Backbone and all involved  all credits will be in code when done :-)

* THERMOSTAT_MENU_LM35_Celcius.ino (15.59 KB - downloaded 15 times.)
« Last Edit: January 06, 2013, 09:11:05 am by Thomas_berg_ » Logged

Roma
Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
Mechmate #70
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Thomas,
.... always from a beginner .... the temperature sensor has some characteristic, the relation between Volt and T. As far as I know,is generally 0,01 V = 1 kelvin degree  and celsius = kelvin -273.
.... this could be a start ... it's important to understand which sensor you use because not all the sensor give the same value ... sorry if I'm obvious or wrong, as I said ... absolute beginner :-)
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 569
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried looking at this yesterday but, unfortunately, it only seems to work with a particular implementation of LiquidCrystal_I2C, the same one as compatible in the New LiquidCrystal Library.

My I2C backpacks work with the other I2C implementation, the one that controls the backlight through the I2C bus, rather than a dedicated arduino pin.

Are thee any plans to make MENWIZ compatible with more than one LCD connection method, as it rather limits scope for take up in this guise, but otherwise looks like it could be an excellent library.

If it were to be included as core library then it would need to work with any LCD connection, certainly with the shields available.

Many thanks.
Logged

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

Menwiz works on any interface method supported by (new) LiquidCrystal.
(new) liquidCrystal library works with the following interfaces (as in https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home)

- 4 bit parallel LCD interface
- 8 bit parallel LCD interface
- I2C IO bus expansion board with the PCF8574* I2C IO expander ASIC such as I2C LCD extra IO.
- ShiftRegister adaptor board as described Shift Register project home or in the HW configuration described below, 2 and 3 wire configurations supported.
- ShiftRegister 3 wire latch adaptor board as described ShiftRegister 3 Wire Home
- Support for 1 wire shift register ShiftRegister 1 Wire

some users adapted Menwiz library to other libraries (to support devices from webrobots , fugaku etc).  I would like to include a summary by the author of such mods in the doc.
I think  it is quite enough ...  smiley-cool
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The New LiquidCrystal library is not limited to any aparticular HW wiring or driver as far as pin out is concerned. The base constructor does assume a particular wiring for all the drivers it is capable of handling, but every class has constructors that enable users to configure the pin mapping of their LCD.

You just need to look at the header files for each driver and see the flexibility.

As far as the backlight is concerned, once again, the default constructor does not assume support for the backlight. However, the I2C flavour of the library does support the control of the backlight, you just need to invoke the correct constructor when crating the LCD object. Again, you need to look in the header files to see which method suits your needs.

Will it be extened to support other I2C IO extension ASICs, it will. Currently it supports the PCF8574 and compatibles which is very much standard.

The other thing that is very nice about the library is that you just need to add a new class, with a few methods to support any other driver you can think off (just need to pass how to write to the device and control the backlight). The rest is done for you.
Logged

   

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I forgot to mention, that the adaptions that #brunialti mentions are just one line of code: the creation of the object that his library uses, a simple pin mapping call in the constructor. He then uses a reference to the abstract class "LCD" throughout his menu library regardless of the LCD or driver used.

@bruinalti - great work. Every time I look it improves by the hour!!!
Logged

   

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 569
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very much appreciate the superb support you guys give in responding so quickly.

I will delve a little deeper into what you've said.

It would be great to switch to using the new library and give MENWIZ a proper try out too.

Many thanks again.
Logged

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

@Khalid
May be i found a bug. Do the line duplication occours when you set root menu as collapsed menu?
If it is true that is a bug I detected and solved. Probably I need to anticipate the release of 1.2.0. version to fix the problem
Salute brunialti,
Due to big size of my code of suntracker, i revert to your version MenWiz1.1,  Can you also rectify the above line duplication bug in MENWIZ1.1?
Thank you for the support.
Regards
Logged


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

Khalid, what's the  problem with size? The 1.2 should'nt differ from 1.1.
« Last Edit: January 06, 2013, 11:37:04 am by brunialti » Logged

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

Khalid, what's the  problem with size? The 1.2 should'nt differ from 1.1.
The v1.1 library is 28K whereas v1.2 library is 29K... However, i still have 3K programm memory in hand.. Your MENWIZ library is awesome smiley
Logged


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

Hi.
for all people interested in "odd" button models (that is 3 or 5 button models) I give you a *very simple* patch to implement it now. The next version will consolidate the change.

Inside the library is implemented a "logical level" where are defined all actions performed  after a button push.
Those functions are private members of class menwiz,  so it is necessary to make just one  change to the MENWIZ.h file, moving  the  definition of actBTE() from private to public. That is all.

In your sketch you can implement a menu entry acting exactly as the escape button as following (example):

Code:
void bte(){
menu.actBTE();}


I'm also trying to use a 5 button analog and can't make the above line compile. It does work if I leave this in Private
Code:
Private:
 void     actBTE();
and use this in Public: with the menu.actBTE commented out. Also BTE needs to be all capitols.
Code:
Public:
void     BTE();
 /* {
 menu.actBTE();
}
*/

When the menu.actBTE is not commented I get these errors :
C:\arduino-1.0.3\libraries\MENWIZ/MENWIZ.h: In member function 'void menwiz::BTE()':
C:\arduino-1.0.3\libraries\MENWIZ/MENWIZ.h:202: error: 'menu' was not declared in this scope


I don't have my display handy so I can't test the compiled code to see if it works.

I'm no c++ expert so I'm not quite sure what to do with this.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 569
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After getting the *new* LiquidCrystal library owing with my I2C expanders I had a quick try of MENWIZ examples last night.

It looks very good and I'll try some altering of menu code in a short while.

Incidentally I'm testing with a 16x2 and it seems fine on two line displays.

One question though:-

The way I would want to use this is as a settings menu that only appears when entered on startup. It will set parameters for a game.

I can see that I'd do this by setting a variable for menu=1 and enter a while loop with the me u worker process running. When I exit the menu then I'll set menu=0 and drop into my main loop.

It looks like there is no lcd.begin() in the main sketch, but rather controlled in the library. This seems to assume that the menu has exclusive use of the LCD.

I will use the LCD for other things too, with the menu only used when required. At start I will have a splash screen, then an optional key combination to enter setup menu. This will be followed by screens showing the current game settings, before a countdown time to start the game, at which point the display will then be a scoreboard display.

Settings will only be able to be hanged at startup, analogous to entering PC BIOS settings.

Can I do this with MENWIZ? Since the LCd is initialized with the menu, it seems that if I don't enter the menu I wouldn't need to do so. But, if I do go into the menu then I might end up with trying to initialize the same lcd object twice.
Logged

Pages: 1 ... 19 20 [21] 22 23 ... 34   Go Up
Jump to: