Menu on LCD
I'm trying to make a menu on LCD. I am using JonnyMac LCD_STR sub
will this work? it there is a better idea to make a selection list on the LCD
tmpw=@menu 'get menu address
do
lcd_str tmpw
do
loop until button=1 ' loop until key is pressed
tmpw=tmpw+10 'get next in menu list
inc tmp2 'next Param
loop until tmp2=5
SUB LCD_STR
sAddr VAR __WPARAM12 ' address of string
sChar VAR __PARAM1 ' character from string
DO
READINC sAddr, sChar ' get a character
IF sChar = 0 THEN EXIT ' if 0, we're done
LCD_OUT sChar ' print the character
LOOP
ENDSUB
menu:
data "Slow Time",0
data "Fast Time",0
data "Cam Time",0
data "Stop Time",0
data "Last Floor",0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
will this work? it there is a better idea to make a selection list on the LCD
tmpw=@menu 'get menu address
do
lcd_str tmpw
do
loop until button=1 ' loop until key is pressed
tmpw=tmpw+10 'get next in menu list
inc tmp2 'next Param
loop until tmp2=5
SUB LCD_STR
sAddr VAR __WPARAM12 ' address of string
sChar VAR __PARAM1 ' character from string
DO
READINC sAddr, sChar ' get a character
IF sChar = 0 THEN EXIT ' if 0, we're done
LCD_OUT sChar ' print the character
LOOP
ENDSUB
menu:
data "Slow Time",0
data "Fast Time",0
data "Cam Time",0
data "Stop Time",0
data "Last Floor",0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Comments
In addition you may need to debounce your signal (when you press the button as it is making contact it will turn on and off rapidly untill the contacts are firmly touching).· This can be addresed by checking the button and not counting the press untill you get the same result several times in a row.
I will study your program
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔