Look at what you have written and you will see why it does not work. Here is a short hint.
MAIN:
lcdout $fe, $80+0, "PUMP off GAS off"
lcdout $fe, $c0+8, "WATER"
if PORTA.2 = 1 then GOTO waterok
if PORTA.2 = 0 then GOTO waterbad
if PORTA.6 = 1 then GOTO tempdown
if PORTA.7 = 1 then GOTO tempup
PAUSE 500
GOTO MAIN
waterok:
lcdout $fe, $c0+13, " OK"
goto main
The problem is that you jump back to main all the time so in this case you will not do the other IF statements. This is why we have GOSUB in PBP, it jumps to a SUB and when you use RETURN you will jump back to the line after..... More or less in any case.
SO
MAIN:
lcdout $fe, $80+0, "PUMP off GAS off"
lcdout $fe, $c0+8, "WATER"
if PORTA.2 = 1 then GOSUB waterok '<------------------- JUMP if true
if PORTA.2 = 0 then GOSUB waterbad
if PORTA.6 = 1 then GOSUB tempdown
if PORTA.7 = 1 then GOSUB tempup
PAUSE 500
GOTO MAIN
waterok:
lcdout $fe, $c0+13, " OK"
RETURN '<------ to exit the SUB and return to MAIN
Get the idea??
M




Bookmarks