The Netherlands
Offline
Full Member
Karma: 1
Posts: 223
|
 |
« Reply #195 on: October 08, 2012, 01:13:27 pm » |
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
Sr. Member
Karma: 13
Posts: 342
|
 |
« Reply #196 on: October 08, 2012, 03:36:15 pm » |
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 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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #197 on: October 11, 2012, 12:28:58 pm » |
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
Sr. Member
Karma: 13
Posts: 342
|
 |
« Reply #198 on: October 11, 2012, 03:12:42 pm » |
Great. Enjoy the lib!
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Full Member
Karma: 1
Posts: 223
|
 |
« Reply #199 on: October 29, 2012, 08:32:52 am » |
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
Faraday Member
Karma: 35
Posts: 5915
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #200 on: November 06, 2012, 01:19:20 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Norway
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #201 on: November 20, 2012, 05:41:06 pm » |
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
Full Member
Karma: 1
Posts: 223
|
 |
« Reply #202 on: November 21, 2012, 06:45:31 am » |
Samples are inside the download of the libabary!
Paco
|
|
|
|
|
Logged
|
Never to old to learn and I learn every day
|
|
|
|
Norway
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #203 on: November 21, 2012, 07:23:21 am » |
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
Sr. Member
Karma: 13
Posts: 342
|
 |
« Reply #204 on: November 22, 2012, 09:48:22 am » |
@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
Sr. Member
Karma: 5
Posts: 318
Arduino rocks
|
 |
« Reply #205 on: December 01, 2012, 08:43:08 am » |
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
Sr. Member
Karma: 5
Posts: 318
Arduino rocks
|
 |
« Reply #206 on: December 09, 2012, 10:26:10 am » |
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
Sr. Member
Karma: 5
Posts: 318
Arduino rocks
|
 |
« Reply #207 on: December 10, 2012, 09:52:02 am » |
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: 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
Sr. Member
Karma: 13
Posts: 342
|
 |
« Reply #208 on: December 10, 2012, 10:21:13 am » |
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
Sr. Member
Karma: 5
Posts: 318
Arduino rocks
|
 |
« Reply #209 on: December 10, 2012, 11:01:54 am » |
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
|
|
|
|
|
|