I have been writing a program that will goto the Pass routine if the sequence of buttons 4-2-3-1 is pressed, any deviation from this and the program will goto the Fail routine.
The program works for the correct sequence, when i press 4-2-3-1 it goes to the Pass routine but there is a slight problem.
The program starts and waits for 4 to be pressed, if 2, 3 or 1 are pressed at this point it goes to the Fail routine like i want. The only problem is that the program then waits for button 2 to be pressed and it doesn't matter what other buttons are pressed at this stage the program will not deviate to the fail routine as I would like, it waits and waits for button 2 to be pressed and then waits and waits for button 3 etc.
Basically I think there is a small problem with subroutine SEQ_1, SEQ_2 and SEQ_3. I want the program to branch off to the Fail routine if the wrong button is pressed within these sub routines.
Enclosed is the program, i'd appreciate any in-sight as to where the error lies.
The program works for the correct sequence, when i press 4-2-3-1 it goes to the Pass routine but there is a slight problem.
The program starts and waits for 4 to be pressed, if 2, 3 or 1 are pressed at this point it goes to the Fail routine like i want. The only problem is that the program then waits for button 2 to be pressed and it doesn't matter what other buttons are pressed at this stage the program will not deviate to the fail routine as I would like, it waits and waits for button 2 to be pressed and then waits and waits for button 3 etc.
Basically I think there is a small problem with subroutine SEQ_1, SEQ_2 and SEQ_3. I want the program to branch off to the Fail routine if the wrong button is pressed within these sub routines.
Enclosed is the program, i'd appreciate any in-sight as to where the error lies.
Attachments
-
9.1 KB Views: 23
Last edited: