PDA

View Full Version : LCD menu



malc-c
- 20th April 2010, 20:10
Need some further advice.

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



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



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...

Charles Linquis
- 21st April 2010, 14:01
You will probably need to add a statement after each selection that
sits it a loop until the button is released.

malc-c
- 21st April 2010, 14:34
Thanks for the reply Charles.

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




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

malc-c
- 21st April 2010, 15:02
Might try the following:



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

aratti
- 21st April 2010, 17:22
If option = 1 Then
If set_butt = 0 Then goto vivs
endif


This will take less code space and will work.

Al.