I have a simple routine that checks a temp then turns on/off a relay but I'm trying to have a momentary switch that latches a different pin high or low. I was thinking that an interrupt would work but it seems to not work on the PICAXE. I'm struggling with that interrupt routine, any suggestions?
symbol R1=B.7
symbol R2=B.6
b1=0
setint %00000100,%00000100
Main:
if b1=0 then
low R2
endif
if b1=1 then
high R2
endif
readtemp C.1,b0
if b0>25 then
high R1
endif
if b0<=25 then
low R1
endif
goto main
Interrupt:
b1=b1+1
if b1=2 then
b1=0
endif
Pause 2000
setint %00000100,%00000100
return
symbol R1=B.7
symbol R2=B.6
b1=0
setint %00000100,%00000100
Main:
if b1=0 then
low R2
endif
if b1=1 then
high R2
endif
readtemp C.1,b0
if b0>25 then
high R1
endif
if b0<=25 then
low R1
endif
goto main
Interrupt:
b1=b1+1
if b1=2 then
b1=0
endif
Pause 2000
setint %00000100,%00000100
return