Hi,
I'm using PICAXE 28x. I need to design a program to control the motors through relays. There are different sequence for the motors.
PROGRAM:
Inputs: pin0 is for ON/OFF purpose
pin1 is for sequence purpose
label_1E: 1st sequence
label_25: 2nd sequence
label_9B: 3rd sequence
label_CF: return to 1st sequence
When input pin0 (ON/OFF)is pressed then 1st sequence is executed. Then, when the sequence1 is interrupted by the pin1 (change sequence) button. The 2nd sequence will be executed after a short delay. So everytime the pin1 is pressed, it will change sequence.
Q1. I would like to program such that when the pin0 (ON/OFF) is pressed to stop(OFF) the whole system. I wanted to use interrupt for the ON/OFF. However, I had used it for changing sequence. If a 2nd interrupt is used, I would like to have a different interrupt program from the 1st one.
Is there other way to OFF the program?
setint %00000000,%00000010
main:
label_6: if pin0=1 then label_6
label_1E: high 0
wait 5
low 0
wait 5
if b1=0 then label_1E
label_25: high 1
wait 1
low 1
wait 1
if b1=1 then label_25
label_9B: high 0
wait 1
low 0
wait 1
if b1=2 then label_9B
label_CF: let b1=0
goto label_1E
interrupt: b1 = b1 + 1
pause 2000
setint %00000000,%00000010
return
THANK YOU
I'm using PICAXE 28x. I need to design a program to control the motors through relays. There are different sequence for the motors.
PROGRAM:
Inputs: pin0 is for ON/OFF purpose
pin1 is for sequence purpose
label_1E: 1st sequence
label_25: 2nd sequence
label_9B: 3rd sequence
label_CF: return to 1st sequence
When input pin0 (ON/OFF)is pressed then 1st sequence is executed. Then, when the sequence1 is interrupted by the pin1 (change sequence) button. The 2nd sequence will be executed after a short delay. So everytime the pin1 is pressed, it will change sequence.
Q1. I would like to program such that when the pin0 (ON/OFF) is pressed to stop(OFF) the whole system. I wanted to use interrupt for the ON/OFF. However, I had used it for changing sequence. If a 2nd interrupt is used, I would like to have a different interrupt program from the 1st one.
Is there other way to OFF the program?
setint %00000000,%00000010
main:
label_6: if pin0=1 then label_6
label_1E: high 0
wait 5
low 0
wait 5
if b1=0 then label_1E
label_25: high 1
wait 1
low 1
wait 1
if b1=1 then label_25
label_9B: high 0
wait 1
low 0
wait 1
if b1=2 then label_9B
label_CF: let b1=0
goto label_1E
interrupt: b1 = b1 + 1
pause 2000
setint %00000000,%00000010
return
THANK YOU