LCD menu


Closed Thread
Results 1 to 5 of 5

Thread: LCD menu

  1. #1
    malc-c's Avatar
    malc-c Guest

    Default LCD menu

    Need some further advice.

    I'm using three buttons to provide menu selection, via a list of options on an LCD

    Code:
    Main:
    
    LCDOUT $FE,2,"Night Time Settings"
    lcdout $FE, $C0, "Use + key for Option"
        IF !plus_butt THEN Option = option + 1
        pause 150
        IF option = 1 THEN lcdout $FE, $D4, "Set Number of Vivs "
        if option = 2 THEN lcdout $FE, $D4, "Set Start Times    "
        if option = 3 THEN lcdout $FE, $D4, "Set Stop Times     "
        if option >3 THEN option = 0
        
    goto main
    This works fine in displaying option I want, however I would like to then goto the desired option by pressing the set button. I tried

    Code:
    if !set_butt AND option = 1 goto Vivs:
    But that didn't work. Does anyone have any suggestions on how to get this working. I can't use "IF option = 1 goto vivs" as this would jump before options 2 and 3 could be selected...

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    You will probably need to add a statement after each selection that
    sits it a loop until the button is released.
    Charles Linquist

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply Charles.

    I was thinking of trying the BRANCHL command, something like (syntax is probably wrong)

    Code:
    if !set_butt BRANCHL B4, [vivs,start,stop]

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Might try the following:

    Code:
    If (option = 1) AND (!set_butt) Then goto vivs
    If (option = 2) AND (!set_butt) Then goto start
    If (option = 3) AND (!set_butt) Then goto stop

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    If option = 1 Then
    If set_butt = 0 Then goto vivs
    endif
    This will take less code space and will work.

    Al.
    All progress began with an idea

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