Log in

View Full Version : Menu Selection#2



lerameur
- 4th November 2011, 02:40
Hello,

I am having a bit of trouble with the algorithm of this menu selection. I have only two button to play with . When I push the Selection button it whiz over the next function.. How do i get around that? button command ?:


SetYear:
ThisYear = 2011
while Selection = 0 ' exit when selection becomes 1 Selection is a buton and next1 is another button on the main panel

lcdout $FE,1, "Set Year"
lcdout $FE,$C0, dec4 ThisYear
pause 300

if NextOption=1 then ThisYear = ThisYear +1 'Button on NextOption (PORTB.3)
if Selection=1 then Goto SetMonth
wend

SetMonth:
ThisMonth= 1
while Selection = 0 ' exit when selection becomes 1 Selection is a buton and next1 is another button on the main panel

lcdout $FE,1, "Set Month"
lcdout $FE,$C0, dec2 ThisMonth
pause 300

if NextOption=1 then ThisMonth=ThisMonth +1
if Selection=1 then Goto SetDay
wend

SetDay:
ThisDay= 1
while NextOption = 0 ' exit when selection becomes 1 Selection is a buton and next1 is another button on the main panel

lcdout $FE,1, "Set Day"
lcdout $FE,$C0, dec2 ThisDay
pause 300

if NextOption=1 then ThisDay=ThisDay +1
if Selection=1 then Goto SetHour
wend

SetHour:
ThisHour= 1
while NextOption = 0 ' exit when selection becomes 1 Selection is a buton and next1 is another button on the main panel

lcdout $FE,1, "Set Hour"
lcdout $FE,$C0, dec2 ThisHour
pause 300

if NextOption=1 then ThisHour=ThisHour +1
if Selection=1 then Goto SetMin
wend

SetMin:
ThisMin= 1
while NextOption = 0 ' exit when selection becomes 1 Selection is a buton and next1 is another button on the main panel

lcdout $FE,1, "Set Min"
lcdout $FE,$C0, dec2 ThisMin
pause 300

if NextOption=1 then ThisMin=ThisMin +1
if Selection=1 then Return
wend:

sayzer
- 4th November 2011, 07:03
When selection becomes 0, have a button bounce after you leave a menu like
while selection = 1 : pause 10 : wend

also, thisday,thishour,thisday have nextoption = 0 instead of selection = 0

?

lerameur
- 4th November 2011, 12:23
This is what I am saying, I have about 5 or six of these functions with the Nextoption=0, but when it is pressed, it skips over 1 0r 2 functions.... I could do it with three button . but that will be confusing. for the user.

k

sayzer
- 5th November 2011, 09:05
When the button is pressed, wait until button is released.
while selection = 1 : pause 10 : wend 'Wait until button is released.
while Nextoption= 1 : pause 10 : wend 'Wait until button is released.

have these before each function or each menu.