Shop OBEX P1 Docs P2 Docs Learn Events
conditional debugin ? — Parallax Forums

conditional debugin ?

georgeslouisgeorgeslouis Posts: 3
edited 2011-02-08 09:56 in BASIC Stamp
hi,
I'm trying to put a prg on a STAMP BS2. This has 2 parts. An automatic part, which is watching for a sensor, and if the sensor gives signal, then the servo runs. The second part is a debugin command. If there is a command, then the servo also runs.
The problem is when I use the debugin part, the second autonome part is not working. It seems that I cannot tell the debugin command, if there is no console input, to do the second part of the program. Can sb pls help ? Thanks in advance ;-)
Georges-Louis

Comments

  • FranklinFranklin Posts: 4,747
    edited 2011-02-07 09:53
    If you use SERIN rather than DEBUGIN you will have a timeout option in the string. DEBUG was implemented for easy debugging programs and was not intended for actual programming although it is used quite a lot.
  • georgeslouisgeorgeslouis Posts: 3
    edited 2011-02-07 12:18
    hi Franklin,
    thanks a lot, good idea for the timer for input. I've tested it, but somehow I do not get the console input into the correct serin in order to receive the 'DEBUG "hallo' below. I'm just getting "time out". I'm using a usb cable. Can you pls help ? Thanks in advance ;-)

    Main:
    SERIN 1, 16468, 2000, No_Data, [DEC result]
    DEBUG ? result
    DEBUG "hallo"


    No_Data:
    DEBUG "Timed out"





    Franklin wrote: »
    If you use SERIN rather than DEBUGIN you will have a timeout option in the string. DEBUG was implemented for easy debugging programs and was not intended for actual programming although it is used quite a lot.
  • georgeslouisgeorgeslouis Posts: 3
    edited 2011-02-08 09:56
    hi Franklin,
    it worked. As I'm using the usb cable, the pin is 16, not 1 ;-)
    thx again for your support
    cheers
    Georges-Louis

    hi Franklin,
    thanks a lot, good idea for the timer for input. I've tested it, but somehow I do not get the console input into the correct serin in order to receive the 'DEBUG "hallo' below. I'm just getting "time out". I'm using a usb cable. Can you pls help ? Thanks in advance ;-)

    Main:
    SERIN 1, 16468, 2000, No_Data, [DEC result]
    DEBUG ? result
    DEBUG "hallo"


    No_Data:
    DEBUG "Timed out"
Sign In or Register to comment.