Simple Menu system on Prop
eagletalontim
Posts: 1,399
I am looking for a basic menu system that I can use to display on my 2 x 16 display. I used to work with the SX but now I am switching over to the Prop and am not sure how to have "Preset menu items" that I can call for and display on the screen. On the SX, there was the DATA function which allowed each character to be "looked up" and then displayed on the screen. Is there something similar to this or easier to work with instead of writing each line like this :
Old SX Code....
lcd.init(24, 9600, 2) lcd.displayOn lcd.backLight(TRUE) waitcnt(2_000_000 + cnt) lcd.gotoxy(0,0) [B]lcd.str(string("Testing String.. "))[/B]
Old SX Code....
showmenu: temp1 = __PARAM1 temp1 = temp1 - 1 temp4 = temp1 IF temp1 > 14 THEN temp1 = temp1 - 15 temp3 = 1 ELSE temp3 = 0 ENDIF temp1 = temp1 * 17 FOR idx = 0 TO 15 IF temp3 = 0 THEN READ Menu1 + temp1, temp2 ELSE READ Menu2 + temp1, temp2 ENDIF INC temp1 PUT line1(idx), temp2 NEXT IF temp4 = 0 THEN PUT line2, "Running... " ELSE PUT line2, "Setting : " ENDIF UPDATE_L1 UPDATE_L2 RETURN Menu1: ' Tags end here DATA "Sample menu 1 : ", 0 DATA " ......... etc... ", 0 Menu2: DATA "Continuing on..... ", 0 DATA "........and on........", 0
Comments
PUB menu
lcd.str(@lcdstring0)
' etc...
'
DAT
lcdstring0 byte "first menu item",0 ' <-- note null terminated
lcdstring1 byte "second menu item",0
' etc