Shop OBEX P1 Docs P2 Docs Learn Events
E-Stop — Parallax Forums

E-Stop

Frank123Frank123 Posts: 4
edited 2013-08-27 09:05 in BASIC Stamp
Hello,
I am new to this forum and I have a question in reference to the Basic 1 or 2. What I need to do is if in2 =0 then it should run the scan program but if in 3 = 0 then I want the scan program to stop and then perform the dial progam. Below is the code but when input 3 is detected the scan progam continues to run.


Check:
If in 2 = 0 then scan
If in 3= 0 then Dial
goto check

Scan:

High 4
pause 100
low 4
pause 100
high 5
pause 100
low 5
goto Check

Dial:
low 4
low5
pause 10
High 6
pause 100
low 6
goto Check.

Comments

  • davejamesdavejames Posts: 4,047
    edited 2013-08-27 08:48
    Hello Frank - welcome to the Forum.

    Could you, please, post *all* the code. This appears to be just a snippet as I see no "scan" label.

    Thanks.
  • 72sonett72sonett Posts: 82
    edited 2013-08-27 09:05
    Frank123 wrote: »
    ... if in2 =0 then it should run the scan program but if in 3 = 0 then I want the scan program to stop and then perform the dial progam.
    So then you should check if IN3 = 0 at some point in the scan program end exit, or jump to the dial program/subroutine if true.
Sign In or Register to comment.