Shop OBEX P1 Docs P2 Docs Learn Events
Interupt — Parallax Forums

Interupt

ensernetensernet Posts: 1
edited 2005-07-06 12:17 in BASIC Stamp
I am trying to come up with a way to change a value in my program without stopping and waiting for input from a debug input.· I have tried to use· ·if debug in = "" then.· The "" meaning equals nothing. This didn't work. Anyone got an idea

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-07-06 12:16
    ensernet -

    It's not exactly clear what you're trying to accomplish, but any of the following methods are available:

    1. You can make a decision on the Nth iteration through a programmed loop.

    2. You can make a decision based on the value of an internally generated pseudo-random number.

    3. You can make a decision based on the value (0 or 1) of one or more of the port pins.

    A bit more informatuon on your part will probably provide other possible alternatives as well.

    Regards,

    Bruce Bates
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-07-06 12:17
    You probably need to know that

    I9600 CON 16384 ' 9600 baud, inverted
    MyVar CON WORD

    DEBUGIN DEC MyVar

    is the same as:

    SERIN 16, I9600, [noparse][[/noparse]DEC MyVar]

    So, you can use SERIN instead of DEBUGIN. Now, SERIN has a time-out paramter. So you can use that to look for input for a little while, run your program some, then look for more input for a little while.

    Look in the Manual under SERIN, and then look for the time-out parameter.
Sign In or Register to comment.