Loading...
Pages: 1 ... 12 13 [14] 15 16 ... 25   Go Down
Author Topic: MENWIZ: yet another character lcd menu wizard library  (Read 23675 times)
0 Members and 1 Guest are viewing this topic.
The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Terry,

Make an VariableOld of each variable you want to save and check if the Variable is not equal to VariableOld.
if that is the case start a timer of 3 seconds.
When the timer is done run the save eeprom command.

So if you keep changing the value the timer is advanced for 3 seconds.
When you stop it saves the values after 3 seconds.

Paco
Logged

Never to old to learn and I learn every day

rome
Offline Offline
Sr. Member
****
Karma: 13
Posts: 342
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Create two menu entries with save and load actions... (see the example for full code.)

Resuming:
Place the two function in your sketch.
Of course you have to declare two menu entries to manage the actions

Code:
   s1=menu.addMenu(MW_VAR,r,F("SAVE TO EPROM"));            
      s1->addVar(MW_ACTION,savevar);                    
    s1=menu.addMenu(MW_VAR,r,F("LOAD FROM EEPROM"));  
      s1->addVar(MW_ACTION,loadvar);                    

... is it what you need?
Logged

Salem, OR
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

brunialti,

Thank you for all of your assistance... I was missing the boat per say on the placement of the code, finally I got my head on straight and now the interface is working perfectly as it should. Your MENWIZ librarys take some time and experimenting to get used to, but once you have a basic understanding It is a very powerful menu system.

Again... Thank you for all your help!

Cheers,

Terry
Logged

rome
Offline Offline
Sr. Member
****
Karma: 13
Posts: 342
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great. Enjoy the lib!
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Roberto,

Can I ask you a question? :-)
When the usermenu is active and one of the 4 keys is activated the regular menu appears.
Is there a possibility in the lib to make it exclude the up and down key function from this?
And if the usermenu is active to make a scroll function through the usermenu when this is more info the display can handle.

I now have to call by menu action a different usermenu. Would be swell if you can scroll through one usermenu with the up and down keys if the usermenu is active.
As soon as the confirm or escape menu is activated the usermenu is left.

Paco

Logged

Never to old to learn and I learn every day

Central MN, USA
Online Online
Faraday Member
**
Karma: 35
Posts: 5915
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought I should check in and share some of work with my LCD panel.

http://arduino.cc/forum/index.php/topic,130945.msg984793.html#msg984793
Logged


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

I got my Arduino several months ago, and have learned a lot on the Forum!

Right now I try to run MENWIZ on a 16x2 4-wire display with 5 analog buttons.

Can anyone point me to a 16x2 code example? (I have read all 14 pages of "MENWIZ: yet another character lcd menu wizard library" ...)

Hans Fredrik
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Samples are inside the download of the libabary!

Paco
Logged

Never to old to learn and I learn every day

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

I have looked at the two examples (quick_tour.ino and Test_all_var_types.ino) in http://github.com/brunialti/MENWIZ. But they are both for 20x4 displays.

Anyone that has some sample code with 16x2 display?

HansF
Logged

rome
Offline Offline
Sr. Member
****
Karma: 13
Posts: 342
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@hufza
unfortunately I have not on hand a 4wire 16x2 display.
The library is unaware of the lcd interface as it is managed by the LiquidCrystal lib.
So please try to get the lcd working with a "hello world" with the provided LiquidCrystal (or the latest available version) example in order to get the correct instantiatio  parameters. After that you can populate the code with the proper MENWIZ call(s).
The affected code line in MENWIZ should be only the begin call as following

menu.begin(&lcd,16,2); //initialize the menwiz menu object passing the lcd object and the colums and rows params
« Last Edit: November 22, 2012, 09:51:27 am by brunialti » Logged

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

Terry,
Nice work and thank you for asking question from the great brunialti. Can you post your complete sketch alongwith the Menwiz here. Again thank you for posting and asking.
brunialti, thank you very much for providing the great menu system to rest of us for free.
Regards
Logged


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

Hi Guys
I first time run the Menwiz with the Terry sketch and i confess i never saw any menu library that good and easy of use. I am using 3-wire LCD and AnalogeButton.

I shall soon post the results with Video. I am really very happy.
Thank you brunialti for the great MenWiz
Thank you backbone for  Analoge Button Sketch
Thank You Terry     for the good sketch of your controller
Thank You rest for their great contributions in library and all the help you providing.
« Last Edit: December 09, 2012, 10:29:42 am by Khalid » Logged


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

Hi brunialti ,
I have a question. If we have a function having conditional WHILE loop or FOR loop  inside void loop(). Then what will happen to navigate buttons and menu.draw function? Will it work or not i.e. screen will display the menu? Will the menu recognize the button press?
For example:
Code:

void loop()    
{
  while(READ_RIGHT_LDR >= lightPoint || darknessDuration < (6*60*60*1000)) //While it's light outside or has been dark for less than 6 hours.CHECK RIGHT SENSOR
  {
    if (READ_RIGHT_LDR >= lightPoint) //If it's light outside
    {
      updatePosition();
      darknessDuration = 0;
    }
    delay(1*10*1000); //Wait 10 sec before checking again.THIS DELAY HAS TO BE CONTROLLED WITH A VARIABLE IN MENU
  }
  menu.draw();
  readButtons();
}


void updatePosition()
{
  int rightSide, leftSide, noChangeCount = 0;
  while (noChangeCount < 5)
  {
    checkHaltSwitches();
    rightSide = READ_RIGHT_LDR;
    leftSide = READ_LEFT_LDR;

    if (leftSide + Sensitivity < rightSide && !moveRightHalted)
    {
      LED_LEFT_OFF;
      MOTOR_OFF;
      delay(50);
      LED_RIGHT_ON;
      MOTOR_RIGHT;
      MOTOR_ON;
#if defined(DEBUG)
      Serial.print("Move Right: ");
#endif
    }
    else if (leftSide > rightSide + Sensitivity && !moveLeftHalted)
    {
      LED_RIGHT_OFF;
      MOTOR_OFF;
      delay(50);
      LED_LEFT_ON;
      MOTOR_LEFT;
      MOTOR_ON;
#if defined(DEBUG)
      Serial.print("Move Left:  ");
#endif
    }
    else
    {
      LED_LEFT_OFF;
      LED_RIGHT_OFF;
      MOTOR_OFF;
#if defined(DEBUG)
      Serial.print("-Centered-: ");
#endif
      noChangeCount++;
      delay(1000);
    }
#if defined(DEBUG)
    Serial.print("leftSide: ");
    Serial.print(leftSide);
    Serial.print(", rightSide: ");
    Serial.println(rightSide);
#endif
    delay(100);
  }
  LED_LEFT_OFF;
  LED_RIGHT_OFF;
  MOTOR_OFF;
#if defined(DEBUG)
  Serial.println("Position updated.");
#endif

  return;
}


« Last Edit: December 10, 2012, 09:54:50 am by Khalid » Logged


rome
Offline Offline
Sr. Member
****
Karma: 13
Posts: 342
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MENWIZ has not its own scheduler. So anything happens at .draw() calltime.
If you make a loop before calling .draw() method (or execute a long lasting code), button checking and any other MENWIZ methods will be delayed until next .draw call.

By the way i'm going to deliver a new version of MENWIZ with some rendering improvement (so called "collapsed menus"). Tests are wellcome !
« Last Edit: December 10, 2012, 10:37:05 am by brunialti » Logged

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

Sure, we are here to test and thank you for improvement in your library. Any way or suggestion how can i write the above piece of code so that MENWIZ can work? any pseudocode?
Logged


Pages: 1 ... 12 13 [14] 15 16 ... 25   Go Up
Print
 
Jump to: