User selectable settings without dip switches [ SOLUTION FOUND ]
beazleybub
Posts: 102
I would like to have a user configureable menu using my BS2 or BS2sx that can be seen with my serial lcd.
I would like to use·three buttons one to access the menu·one to scroll through selections and one to save the selection.
I do know how to write to memory and also how to use the serial lcd but am unsure how to approach the menu.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!
Post Edited (beazleybub) : 8/15/2008 6:52:40 PM GMT
I would like to use·three buttons one to access the menu·one to scroll through selections and one to save the selection.
I do know how to write to memory and also how to use the serial lcd but am unsure how to approach the menu.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!
Post Edited (beazleybub) : 8/15/2008 6:52:40 PM GMT
Comments
In your case, the only BUTTON statement in your main program would be the one to test for the 1st button in order to enter the menu routine.
You'd need to keep a counter for the different menu choices, initialized to zero. Whenever you press the 2nd button (while you're in the menu routine), the counter would be incremented (and wrap around), then the display menu routine would update the LCD contents based on the counter value. If the 3rd button is pressed while you're in the menu routine, the counter value would be used to do whatever is selected after the LCD is updated to show that a choice was made, then the menu routine would exit. If you want, if the 1st button is pressed while in the menu routine, you could just return (so it would work like a CANCEL).
Unfortuneately it now uses 32% of the eeprom but I hope experienced users will have a go with it and make·some improvements if possible.
Thank you.
Edited:· August 15 2008
Reason: Removed Obsolete File
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!
Post Edited (beazleybub) : 8/15/2008 6:44:25 PM GMT
Here is the newest menu I have created using the BS2sx.
I have managed to use scratchpad RAM freeing up quite a bit of regular RAM leaving plenty of room for variables.
This program is intended for the BS2sx or equivalent only because of the program size (85% EEPROM slot).
I think·it is well suited for slot useage.
The program is attached......
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!
Exmaple:
Dsp1:
text$·= "First Option"
Printer
·Return
Dsp2:
text$ = "Second Option"
Printer
return
Printer:
DEBUG CRSRXY, 0, 10, CLREOL, text$
GET 54, Work
DEBUG CRSRXY, 0, 11, CLREOL, DEC Work
RETURN
... Wait, can you nest returns like that with a stamp? I dont remember. Its 3AM, im going to bed, lol
... Or instead of calling DspX just set text$ = , then call printer... Thought I was going to bed...
Post Edited (GICU812) : 8/16/2008 7:03:33 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!