Menu selection


Results 1 to 8 of 8

Thread: Menu selection

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok basically I am looking for :
    The LCD module will show the discharging/charging percentage of the battery.
    The time of each discharge and charge cycle are accumulated in an array.

    when the user hit a button, it will put him into a menu. On another button the user can go through the array and view the charge dicharge time one by one. When no selection is done for 15 seconds, The program returns to the previous state.

    K
    I use something similar in one of my projects - uses a 4 x 20 LCD

    Code:
    mainmenu:
    
    LCDOUT $FE,2,"Main Menu"
    lcdout $FE, $C0, "Select Option"
    
    IF Option = 1 THEN lcdout $FE, $D4, "option 1  "
    if option = 2 then lcdout $FE, $D4, "option 2   "
    if option = 3 then lcdout $FE, $D4, "option 3  "
    if option = 4 then lcdout $FE, $D4, "option 4 "
    if option = 5 then lcdout $FE, $D4, "option 5  "
    if option = 6 then lcdout $FE, $D4, "option 6  "
    
        
    IF !H_butt THEN Option = option + 1
    pause 200
    if option >6 then option = 1
       
    If option = 1 Then
    If S_butt = 0 Then
    LCDOUT $FE,1 
    Gosub SetButtonRelease
    goto  option_one
    endif
    endif
    
    
    If option = 2 Then
    If S_butt = 0 Then 
    LCDOUT $FE,1
    Gosub SetButtonRelease
    goto option_two
    endif
    endif
    
    .... etc etc for all remaining options
    To do the time out you could use something like

    Code:
    	Pause 1			' Kill 1mS 
    	TimeOut=TimeOut+1
    	If TimeOut>20000 then goto mainprogram
    Obviously you need to either set or use your own variables

    Hope that helps
    Last edited by malc-c; - 19th November 2010 at 17:16.

Members who have read this thread : 0

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