Hi all.
Not sure if what I am trying to do is at all possible, but here goes.
I am wanting to control a spa heater & pump with a PICAXE 18X. There is a button on the spa that I am using as an interrupt (with SETINT) to change between auto,off & manual modes.
My problem is that I don't want the program to return to where it was interrupted as I now want it to be running a seperate subroutine (auto>off>manual>off>auto>off... etc. etc.), so the code never gets to the RETURN and therefore never resets the interrupt.
I am reasonably new to this and have tried a few different ways arround this but am stumpped now.
The first interrupt works as expected and turns everything into the OFF mode. But that is where it stays.
The program simulates exactly the way I want it to, but not in the real world sadly.
Hope you understand what I'm after, and I really hope there is a solution other than checking the interrupt input every few lines of code.
Cheers for the help,
V8surf
Not sure if what I am trying to do is at all possible, but here goes.
I am wanting to control a spa heater & pump with a PICAXE 18X. There is a button on the spa that I am using as an interrupt (with SETINT) to change between auto,off & manual modes.
Code:
Interrupt:
SOUND buzzer,(100,5,75,5,125,5)
LOW buzzer
IF b4 = 1 then let b4 = 2 'increase spa mode
ELSEIF b4 = 2 then let b4 = 3
ELSEIF b4 = 3 then let b4 = 4
ELSEIF b4 = 4 then let b4 = 1
ENDIF
IF b4 = 1 then goto autostart 'auto startup routine
IF b4 = 2 then goto notonstart 'off startup routine
IF b4 = 3 then goto manualstart 'manual ON startup routine
IF b4 = 4 then goto notonstart 'off startup routine
SETINT %00000001,%00000001
RETURN
I am reasonably new to this and have tried a few different ways arround this but am stumpped now.
The first interrupt works as expected and turns everything into the OFF mode. But that is where it stays.
The program simulates exactly the way I want it to, but not in the real world sadly.
Hope you understand what I'm after, and I really hope there is a solution other than checking the interrupt input every few lines of code.
Cheers for the help,
V8surf