Has anyone created a menu system for a RS232 LCD? I have 'up, down, left, right and OK' switches to navigate through a menu with sub menus. I am using a 28X Picaxe.
My current code is very long winded and would be tricky to add submenus and extra menus later..
is there a way to navigate around a table or matrix?
Cheers....
main: b0=0
serout 7,N2400,(254,1)
serout 7,N2400,("Menu Active")
serout 7,N2400,(254,12)
pause 1000
goto menu1
menu1: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light GREEN LED <OK")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BLUE LED")
m1loop:
;if pin1=1 then action1
button 4,1,254,0,b0,1,action1
;if pin2=1 then menu2
button 3,1,254,0,b0,1,menu2
button 0,1,254,0,b0,1,main
goto m1loop
menu2: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light GREEN LED")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BLUE LED <OK")
m2loop:
;if pin1=1 then action2
button 4,1,254,0,b0,1,action2
;if pin3=1 then menu1
button 2,1,254,0,b0,1,menu1
button 3,1,254,0,b0,1,menu3
button 0,1,254,0,b0,1,main
goto m2loop
menu3: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light BLUE LED")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BOTH LEDs <OK")
m3loop:
;if pin1=1 then action2
button 4,1,254,0,b0,1,action3
;if pin3=1 then menu1
button 2,1,254,0,b0,1,menu2
button 0,1,254,0,b0,1,main
goto m3loop
action1:
low 1
high 0
pause 500
goto menu1
action2:
low 0
high 1
pause 500
goto menu2
action3:
High 1
High 0
goto menu3
My current code is very long winded and would be tricky to add submenus and extra menus later..
is there a way to navigate around a table or matrix?
Cheers....
main: b0=0
serout 7,N2400,(254,1)
serout 7,N2400,("Menu Active")
serout 7,N2400,(254,12)
pause 1000
goto menu1
menu1: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light GREEN LED <OK")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BLUE LED")
m1loop:
;if pin1=1 then action1
button 4,1,254,0,b0,1,action1
;if pin2=1 then menu2
button 3,1,254,0,b0,1,menu2
button 0,1,254,0,b0,1,main
goto m1loop
menu2: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light GREEN LED")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BLUE LED <OK")
m2loop:
;if pin1=1 then action2
button 4,1,254,0,b0,1,action2
;if pin3=1 then menu1
button 2,1,254,0,b0,1,menu1
button 3,1,254,0,b0,1,menu3
button 0,1,254,0,b0,1,main
goto m2loop
menu3: serout 7,N2400,(254,128)
serout 7,N2400,(254,1)
serout 7,N2400,("Light BLUE LED")
serout 7,N2400,(254,192)
serout 7,N2400,("Light BOTH LEDs <OK")
m3loop:
;if pin1=1 then action2
button 4,1,254,0,b0,1,action3
;if pin3=1 then menu1
button 2,1,254,0,b0,1,menu2
button 0,1,254,0,b0,1,main
goto m3loop
action1:
low 1
high 0
pause 500
goto menu1
action2:
low 0
high 1
pause 500
goto menu2
action3:
High 1
High 0
goto menu3