Shop OBEX P1 Docs P2 Docs Learn Events
How do I stop/break a program that is running — Parallax Forums

How do I stop/break a program that is running

stevebzzzzzstevebzzzzz Posts: 38
edited 2011-07-15 17:22 in BASIC Stamp
Hi,

Dumb question, but I have the BS2 Homework board. Is there any command I can issue from the PC to stop a running program? I know I can erase the program and then run it that way, but I was wondering if there is an easier way. There is no switch (Yet) on my board, so pressing the reset butting just starts the endless loop...well...you know what I mean :tongue:

Thanks Steve

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2011-07-15 17:21
    You didn't post any code, So I assume your using DEBUG in your code?
    '
    If you look at DEBUGIN, You can read data from the PC and make a program jump(subroutine)
    '
    You can add a IF THEN to your main code to read a ASCII character sent back from the DEBUG window to jump to a stop (subroutine)
    '
    Take a little time and read through these.(15 minute read, 30 minutes at the most)
    '
    http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/SortField/0/Level/a/ProductID/143/Default.aspx
    '
    http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf
    '
    Read into the serial part too!
  • davejamesdavejames Posts: 4,047
    edited 2011-07-15 17:22
    Hi Steve - I would say "no", not unless the program on the Stamp is looking for some particular information coming in via SERIN from the PC.

    There is a way to force a "break" condition on the serial port, but all the Stamp does at that point is reset and start running (as it's designed to do).

    The only other idea to offer is for the Stamp program to monitor the state of an I/O pin that's set by a switch. Testing on the pin would allow the program to jump out of whatever it's doing and go do something else.


    I'm sure other more experienced users will have other thoughts,

    DJ
Sign In or Register to comment.