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

something like the following (not tested nor compiled, just for example):

Code:
long startdarkness=0, lastread=0;
void setup(){
}

void loop(){

if ((millis()-lastread)>10000)){   // first read after 10 secs since start
  if (checkligth() {   // ligth outside
      startdarkness=0;
      lastread=millis(); // store last check time
     }
  else{ //dark outside
     if(stardarkness==0)        // no darkness in previous check
        startdarkness=millis();     
     }
}
if( (millis()-startdarknes)< LAPTIME){
//... DO YOUR STUFF....
  }
menu.draw();
}

byte checkligth(){

// this function must return 0 if dark, 1 otherwise

}


by the way what is readbuttons()?
Logged

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

Hi guys!
I need test volunteers for the 1.1.0 version here attached before  github publishing.
This version introduces the following improvements:
  • smaller footprint. About 1.6 Kb less of progmem (and few tens of bytes of heap). As the library does not use anymore sprintf function, in order to save the above mentioned memory amount, the user code need to avoid sprintf as well
  • implementation of the "collapsed menu" rendering. This behaviour is available only in the 6 buttons mode (as I could not find an interaction model for the 4 buttons mode...)

Please test at first with existing code, in order to be sure i did'nt introduce regressive errors.
After test the new behaviour

Thanks!


* TEST MENWIZ 1-1-0.zip (155.54 KB - downloaded 11 times.)
« Last Edit: December 11, 2012, 04:41:50 pm by brunialti » Logged

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

something like the following (not tested nor compiled, just for example):



by the way what is readbuttons()?
That is some brilliant piece of code i was looking for:) Thank you very much... The readbuttons() is a custom function for reading a state of button using analogpin of arduino and it is working very well here:)
I will test today the collapse menu new features of MENWIZ and let you tell the results.
Thank you again.
Regards
Logged


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

I am getting following error when i loaded the example with just adding the custom button function. My sketch is also attached.

* Test_all_var_types_new2.ino (9.14 KB - downloaded 16 times.)

* problem.jpg (125.28 KB, 503x600 - viewed 30 times.)
Logged


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

addUsrNav has now two parameters. The first one is the callback function expected to give back the button code, the other one is the number of buttons emulated by the call back function declared as first parameter (allowed values: 6 or 4).
You do not need anymore to set the *internal* variable MW_navbtn (you can delete following code line in the sketch!)
in your case the correct call  is:

menu.addUsrNav(navMenu,6);

I need to explicitly describe the syntax in the manual....
« Last Edit: December 12, 2012, 03:50:19 pm by brunialti » Logged

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

Okay, Now its running fine and i can enter into submenu "MEASURE SUBMENU" as i am using only 4 buttons (CONFIRM, ESCAPE, UP and DOWN) so i am unable to change the Variable parameters. I think the LEFT and RIGHT buttons are intended to do the same. As i have the six button but two buttons are not implemented so unable but soon i will update the code of all six buttons and will let you tell.
The menu by the way is working very good and i really like the collapsing feature. It will save a lot of space on the screen and organizing the program.
Keep in mind i am using custom function for controlling the six keys keypad that is driven by one Analogue pin of Arduino.
Brilliant:)
Whats coming up next:)
Now how to store an integer value in EEPROM? you have given loadvar and savevar functions but can you define how we put the integer value (2 bytes) in EEPROM address say 0 and 1.

Code:
void savevar(){
  menu.writeEeprom();
  }
 
void loadvar(){
  menu.readEeprom();
  }

Regards
Logged


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

The EEPROM save/load functions apply only to the MENWIZ variables.
The save function stores the variable in FIFO mode (first to be declared, first to be saved). So in theory  the first defined variable *should* be stored in the first 2 bytes of EEPROM space.
Logged

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

The EEPROM save/load functions apply only to the MENWIZ variables.
The save function stores the variable in FIFO mode (first to be declared, first to be saved). So in theory  the first defined variable *should* be stored in the first 2 bytes of EEPROM space.

You are Genius ..This means i have no worries about storing the variables (int, float etc) in EEPROM. Your MENWIZ is taking care of it by storing and retrieving the variables info smiley
I also think that once program/sketch burns in the Arduino. The location of variables in the EEPROM will be always same. Suppose the first variable stored in 0 and 1 address of EEPROM. It will always store and retrieve from the same address throughout the life of the program.

I really like the ease of your library. Thank you for all of your hardwork.
What are your future plans smiley
Regards
« Last Edit: December 13, 2012, 06:44:44 am by Khalid » Logged


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

Yes. You have not to take care about allocation. It is a MENWIZ duty ....
All variables are stored/loaded togheter with one function call.

All is in the example.
« Last Edit: December 13, 2012, 07:29:34 am by brunialti » Logged

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

Yes. You have not to take care about allocation. It is a MENWIZ duty ....
All variables are stored/loaded togheter with one function call.

All is in the example.
Thats Cool features .. Your programming is unbelievable..Just saw the MENWIZ.cpp and Header file and your programming skills are at par excellence.
Logged


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

Hi,
I implemented the Left and Right button in the sketch. But in your new COLLAPSE MENU i think the Left and Right buttons are not implemented for the List : 1/4????
When i entered into BASIC PARAMETERS, i can change following variables parameters:
float Variable:26.0
byte var:50
boolean var:[0]

but i can not change the
list: 1/4
Logged


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

Another Observation is:
Saving and Loading from EEPROM is not functioning. For example when i presss change the parameters of variables  SAVE TO EEPROM, then i shutdown the Arduino. When i power up the Arduino, and press LOAD THE EEPROM nothing happen. No values of BASIC PARAMETERS loaded.
Any thing wrong???
Logged


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

It seems to me that for lists does not make any sense manage the index. I have to introduce some correct behaviour. But still i do nt know what.
I'll check eeprom funcs
Logged

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

Okay:).. But kindly must look into the eeprom functionality.
Regards
Logged


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

I cannot replicate the problem. The eeprom functions seems to work properly in my environment.
Check the following:
- sequence: SAVE TO EPROM/LOAD FROM EPROM . Once this "error" arose because the user mistakenly used the WRITE TO SERIAL entry instead of SAVE TO EPROM menu entry
- after value changes did you confirmed with "enter" button?
« Last Edit: December 14, 2012, 04:35:35 pm by brunialti » Logged

Pages: 1 ... 13 14 [15] 16 17 ... 32   Go Up
Jump to: