Shop OBEX P1 Docs P2 Docs Learn Events
BS2p variable stuck — Parallax Forums

BS2p variable stuck

ArchiverArchiver Posts: 46,084
edited 2004-04-16 07:13 in General Discussion
Hi

I have narrowed a problem down to stuck variable(s) (true) in a
program.
I had prev. thought it to be an input problem, but now have the input
and outside world isolated except for my output pin.

any label like this,

label VAR Bit is always true even if I write label = 0

program is runing ok, debug shows the problem and my IF label Then is
showing that the label is true.

any ideas? bad stamp?

Bruce

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-13 20:06
    Bruce:

    No, I'm pretty sure it's not a bad Stamp. I'm quite certain it's a
    programming error. Put this bit of code just after your declarations
    (before ANY code can run) and you should see the bit flipping
    back-and-forth.

    Test:
    DEBUG HOME, BIN1 label
    label = ~label
    PAUSE 500
    GOTO Test

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: etech500 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Oe5dJ2_GUOo4eyjmlBrPO81CnU_iKrBEYUIQYl_ZIXvVIdlPaG-3_dhIc7ygo2w4fz6BLaR8]bmwbruce@a...[/url
    Sent: Tuesday, April 13, 2004 1:47 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] BS2p variable stuck


    Hi

    I have narrowed a problem down to stuck variable(s) (true) in a
    program.
    I had prev. thought it to be an input problem, but now have the input
    and outside world isolated except for my output pin.

    any label like this,

    label VAR Bit is always true even if I write label = 0

    program is runing ok, debug shows the problem and my IF label Then is
    showing that the label is true.

    any ideas? bad stamp?

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-13 20:12
    In a message dated 4/13/2004 2:55:32 PM Eastern Daylight Time,
    bmwbruce@a... writes:


    > I have narrowed a problem down to stuck variable(s) (true) in a
    > program.
    > I had prev. thought it to be an input problem, but now have the input
    > and outside world isolated except for my output pin.
    >
    > any label like this,
    >
    > label VAR Bit is always true even if I write label = 0
    >
    > program is runing ok, debug shows the problem and my IF label Then is
    > showing that the label is true.
    >
    > any ideas? bad stamp?
    >

    Try renaming your label variable to label1

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-14 06:28
    thanks for info,

    I have improved on it by getting my MAINIO and AUXIO statements in
    place and now I have control from a switch but DEBUG still says it is
    always true even when input is gnd and the label is performing
    correctly as false in my IF statements. oh, well I'll post more as
    I fix it. Can't have too much info in the archives ya know

    Bruce






    --- In basicstamps@yahoogroups.com, "etech500" <bmwbruce@a...> wrote:
    > Hi
    >
    > I have narrowed a problem down to stuck variable(s) (true) in a
    > program.
    > I had prev. thought it to be an input problem, but now have the
    input
    > and outside world isolated except for my output pin.
    >
    > any label like this,
    >
    > label VAR Bit is always true even if I write label = 0
    >
    > program is runing ok, debug shows the problem and my IF label Then
    is
    > showing that the label is true.
    >
    > any ideas? bad stamp?
    >
    > Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-14 14:13
    Bruce,

    Posting your errant code would probably lead to a quicker solution.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: etech500 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=kPgrinfpdyOe3ZhHOAD1rBpMCHDwM5jxe0emjusbC8M4n88ZtzLPnkJfzmHZUN2-7YKZgSZdXBOJ9A]bmwbruce@a...[/url
    Sent: Wednesday, April 14, 2004 12:29 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: BS2p variable stuck


    thanks for info,

    I have improved on it by getting my MAINIO and AUXIO statements in
    place and now I have control from a switch but DEBUG still says it is
    always true even when input is gnd and the label is performing
    correctly as false in my IF statements. oh, well I'll post more as
    I fix it. Can't have too much info in the archives ya know

    Bruce






    --- In basicstamps@yahoogroups.com, "etech500" <bmwbruce@a...> wrote:
    > Hi
    >
    > I have narrowed a problem down to stuck variable(s) (true) in a
    > program.
    > I had prev. thought it to be an input problem, but now have the
    input
    > and outside world isolated except for my output pin.
    >
    > any label like this,
    >
    > label VAR Bit is always true even if I write label = 0
    >
    > program is runing ok, debug shows the problem and my IF label Then
    is
    > showing that the label is true.
    >
    > any ideas? bad stamp?
    >
    > Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-16 07:13
    I got it all working ! (BS2p-40) It was just a matter of having the
    MAINIO, AUXIO in the right places and also having the debug's in the
    right places for the program flow.

    Part of the problem was writing too much code and trying to debug it.
    Bad code can really present some weird problems, I always learn the
    hard way.....

    This basic stamp stuff is really cool.

    Bruce







    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Bruce,
    >
    > Posting your errant code would probably lead to a quicker solution.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: etech500 [noparse][[/noparse]mailto:bmwbruce@a...]
    > Sent: Wednesday, April 14, 2004 12:29 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: BS2p variable stuck
    >
    >
    > thanks for info,
    >
    > I have improved on it by getting my MAINIO and AUXIO statements in
    > place and now I have control from a switch but DEBUG still says it
    is
    > always true even when input is gnd and the label is performing
    > correctly as false in my IF statements. oh, well I'll post more
    as
    > I fix it. Can't have too much info in the archives ya know
    >
    > Bruce
    >
    >
    >
    >
    >
    >
    > --- In basicstamps@yahoogroups.com, "etech500" <bmwbruce@a...>
    wrote:
    > > Hi
    > >
    > > I have narrowed a problem down to stuck variable(s) (true) in a
    > > program.
    > > I had prev. thought it to be an input problem, but now have the
    > input
    > > and outside world isolated except for my output pin.
    > >
    > > any label like this,
    > >
    > > label VAR Bit is always true even if I write label = 0
    > >
    > > program is runing ok, debug shows the problem and my IF label Then
    > is
    > > showing that the label is true.
    > >
    > > any ideas? bad stamp?
    > >
    > > Bruce
Sign In or Register to comment.