Shop OBEX P1 Docs P2 Docs Learn Events
Weared Variables In Debug !!HELP!! — Parallax Forums

Weared Variables In Debug !!HELP!!

14ME7614ME76 Posts: 2
edited 2008-01-23 22:26 in BASIC Stamp
Hi I Have The BS2 Kit Found At: http://parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/CategoryID/11/List/0/SortField/0/Level/a/ProductID/294/Default.aspx

I Need Help With This Code:



' {$STAMP BS2}
' {$PBASIC 2.5}

a······ VAR······ Word(8)
OUTPUT 5
beginsetup:
a = 0
Main:
· a = a + 1
· HIGH 5
· PAUSE 500
· LOW·5
· PAUSE 150
· HIGH·5
· PAUSE 150
· LOW·5
· PAUSE 150
· HIGH·5
· PAUSE 150
· LOW·5
· PAUSE 150
· IF (a = 11) THEN
··· DEBUG CLS
··· GOTO beginsetup
· ELSE
··· GOTO Sub
· ENDIF
· Sub:
··· DEBUG a, " Loop Completed", CR
··· GOTO Main

But the result is NOT RIGHT

Here It Is:


·Loop Completed

······························· oop Completed
Loop Completed
·Loop Completedd


·Loop Completed

······························· oop Completed
Loop Completed
·Loop Completedd

·Loop Completed
·Loop Completed
Loop Completed
········ Loop Completed

·Loop Completed

I Remember That At One Point·It·Replaced One Line The previous Loop Created
My computer Is I Think Confused With the Incoming Data

I Have Tried The Driver Troubleshooters, But May Not Have Done Them Correctly

!!!!HELP!!!HELP!!!HELP!!!!

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-01-23 21:44
    Make this Revision (to display value of VAR a ) --
    · Sub:
    ··· DEBUG DEC a, " Loop Completed", CR
    ··· GOTO Main
  • 14ME7614ME76 Posts: 2
    edited 2008-01-23 21:57
    great it works but what about:

    Main:
    W VAR Word
    Q DATA "Hi"
    READ Q, W
    DEBUG w, CR

    Where do I go for more info.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-01-23 22:13
    14ME76 asked...
    Where do I go for more info.
    It's called PBASIC Help, it's part of the I.D.E.· Look up DEBUG there.
  • JedJed Posts: 107
    edited 2008-01-23 22:26
    You need to preface the variable with the formatter DEC so that stamp knows how to output the values (decimal). Look in the stamp language reference manual under DEBUG to learn more about the formatters.
Sign In or Register to comment.