Hi,
I'm using a 28X picaxe board. I need to design a program to control the motors through relays.
PROGRAM:
Inputs: pin0 is for ON/OFF purpose
pin1 is for sequence purpose
Outputs: high/low 0 and high/low1 (temporary use on LEDs on the board to see the different sequence)
label_1E: 1st sequence
label_25: 2nd sequence
label_9B: 3rd sequence
label_CF: return to 1st sequence
When input pin0 is pressed then 1st sequence is executed. Then, when the sequence1 is interrupted by the pin1 button. It will jump to the interrupt program and return back to the point it was interrupted after the interrpt program is executed. So everytime the pin1 is pressed, it will change sequence.
PROBLEM: I do not how to program the program such that when the pin0 (ON/OFF) is pressed then the currently whole program will stop until the pin0 is pressed again the next time. Can use another interrupt for the ON/OFF?
HELP!!!
Thank you.
I'm using a 28X picaxe board. I need to design a program to control the motors through relays.
PROGRAM:
Inputs: pin0 is for ON/OFF purpose
pin1 is for sequence purpose
Outputs: high/low 0 and high/low1 (temporary use on LEDs on the board to see the different sequence)
label_1E: 1st sequence
label_25: 2nd sequence
label_9B: 3rd sequence
label_CF: return to 1st sequence
When input pin0 is pressed then 1st sequence is executed. Then, when the sequence1 is interrupted by the pin1 button. It will jump to the interrupt program and return back to the point it was interrupted after the interrpt program is executed. So everytime the pin1 is pressed, it will change sequence.
PROBLEM: I do not how to program the program such that when the pin0 (ON/OFF) is pressed then the currently whole program will stop until the pin0 is pressed again the next time. Can use another interrupt for the ON/OFF?
HELP!!!
Code:
'BASIC converted from flowchart:
'C:\DOCUMENTS AND SETTINGS\STUDENT\DESKTOP\MM.CAD
'Converted on 9/20/2007 at 13:59:23
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.
Last edited by a moderator: