Shop OBEX P1 Docs P2 Docs Learn Events
Trouble with DATA Function — Parallax Forums

Trouble with DATA Function

Emartin0713Emartin0713 Posts: 3
edited 2011-07-18 00:13 in BASIC Stamp
I'm using the DATA function to store and recal numbers. The Basic stamp syntax and reference manual says that it will store and return numbers up to 65,535. I cant get it to recall anything higher than 255. is there anything special I am supposed to do for numbers higher than 255? my variable is a WORD and I have tried storing in Dec, Hex and Bin.. same result for all three.

Comments

  • Clive WakehamClive Wakeham Posts: 152
    edited 2011-07-17 17:23
    What is your program?
    Its a bit hard to determine the error without viewing the program.
  • Emartin0713Emartin0713 Posts: 3
    edited 2011-07-17 17:38
    the program I am using is attatched. this was originaly made to run six leds. I am changing it to run 14. pins 0 - 13 ar connected to LEDs pin 14 is a 10k pot with a 0.1 micro Farad capacitor. pin 15 is a normally open push button.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-17 22:38
    By default, DATA stores bytes. You have to use the WORD prefix to get DATA to store a word as two bytes. See the Stamp Manual or the help files on the READ / WRITE / DATA statements for examples. You also have to use the WORD prefix in the READ or WRITE statements.
  • Emartin0713Emartin0713 Posts: 3
    edited 2011-07-18 00:13
    Thank you! That helped!
Sign In or Register to comment.