That bit has been reworked as follows...
Code:
check_button:
if btn_up = 0 OR btn_dwn = 0 OR btn_back = 0 _ ' If any button is pressed...
OR btn_nxt = 0 OR btn_entr = 0 _ ' and the LCD Backlight is on...
and lcd_lite = 1 then ' Then Go to button loop
goto button_loop
endif
if btn_up = 0 OR btn_dwn = 0 OR btn_back = 0 _ ' If any button is pressed...
OR btn_nxt = 0 OR btn_entr = 0 _ ' and the LCD backlight is not on...
and lcd_lite = 0 then ' Then turn on the backlight...
high lcd_lite ' ...and pause 2 seconds
pause 2000 ' Holding the button longer than 2 sec. gets you to...
endif ' the button loop VIA the mainloop & check_button and...
return ' IF statement above.
But the GOTO / GOSUB seems ok... At least is seems to be working.
Code:
button_loop:
'
if btn_up = 1 and btn_dwn = 1 and btn_back = 1 _ ' If no buttons are pressed go to mainloop...
and btn_nxt = 1 and btn_entr = 1 then
goto mainloop
endif ' Otherwise continue...
button_set_loop:
if btn_up = 0 then up ' If the up button is pressed go to the Up loop
if btn_dwn = 0 then down ' If the down button is pressed go to the Down loop
if btn_back = 0 then back ' If the back button is pressed go to the Back loop
if btn_nxt = 0 then forward ' If the next button is pressed go to the Next loop
if btn_entr = 0 then ' If the enter button is pressed go to the Enter loop
goto enter
else
goto button_loop ' If no buttons are pressed run the button loop again...
endif ' ... which takes you to the main loop.
up:
while btn_up = 0 ' While the Up button is pressed do this loop...
pause 30 ' pause for 30 milliseconds
alrm_set = alrm_set + 1 ' increase alarm set point by one degree F
lcdout $FE, 1, "Alarm Set ", _ ' Display the alarm set point as it's changed
dec (alrm_set),$DF, "F"
pause 300
wend ' Repeat, increasing it 1 degree F every ~1/3...
lite_timer = 0 ' ... second until the switch is released
goto button_loop
down:
while btn_dwn = 0
pau... (and it continues)
The check_button loop returns to the main loop, the button_loop series all end with a GOTO mainloop so it finds its way back. In the code above what I wanted to accomplish was that any button press would turn on the LCD backlight but not increment the variable in button_loop in doing so. The above code work pretty well though I may back off the 2 second pause.
I'm aware that there is much room for improvement in both the code and the hardware... I'm learning as I go. I'm working with a deadline of April 17th so I don't have the time to pretty it up. The hardware is functional with some software work-arounds... Rev B will be awesome! 
The IF statement about all the buttons being "1" (not pressed) is likely not necessary since it was a button press that got me there in the first place. Cleaning up that stuff will come later, right now it doesn't break anything and I'm not tight on space yet.
Thanks for looking it over I'm grateful for any tips.
PS I know... interrupts and timers... in Rev B
Bookmarks