Button Help
David92680
Posts: 10
Below is some button code that I put together so it will jump threw 6 options in a menu list. The problem that im having is that its all over the place. Headl work just fine its when you hit headr it jumps from 0 to 3. Why. Any suggestions ive been working on this for the past few days and nothing.
ButtonHit VAR Byte
MenuState VAR Word
headl PIN 3 ' input left Command
headr PIN 5 ' input Right Command
heade PIN 4 ' input Run Command
MenuState = 0 ' zero is the 'starting' menu.
IF (headl = 1) THEN
ButtonHit = Buttonhit + 1 // 6
menustate = menustate + 1 // 6
ELSEIF (headr = 1) THEN
ButtonHit = Buttonhit - 1 // 6
menustate = menustate - 1 // 6
ELSEIF (Heade = 1) THEN
GOSUB Main_Output
ENDIF
PAUSE 200
RETURN
Post Edited (David92680) : 5/13/2008 1:38:42 AM GMT
ButtonHit VAR Byte
MenuState VAR Word
headl PIN 3 ' input left Command
headr PIN 5 ' input Right Command
heade PIN 4 ' input Run Command
MenuState = 0 ' zero is the 'starting' menu.
IF (headl = 1) THEN
ButtonHit = Buttonhit + 1 // 6
menustate = menustate + 1 // 6
ELSEIF (headr = 1) THEN
ButtonHit = Buttonhit - 1 // 6
menustate = menustate - 1 // 6
ELSEIF (Heade = 1) THEN
GOSUB Main_Output
ENDIF
PAUSE 200
RETURN
Post Edited (David92680) : 5/13/2008 1:38:42 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen