Menu Selection#2


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default Menu Selection#2

    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 ?:

    Code:
    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:

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Menu Selection#2

    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

    ?
    Last edited by sayzer; - 4th November 2011 at 07:41. Reason: correction 0 => 1
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Menu Selection#2

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Menu Selection#2

    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.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts