Shop OBEX P1 Docs P2 Docs Learn Events
READ syntax issue....location not incrementing properly? — Parallax Forums

READ syntax issue....location not incrementing properly?

R. KinslerR. Kinsler Posts: 5
edited 2007-05-19 06:40 in BASIC Stamp
Hello all,

Need a little programming help. I wrote the attached code, with the intention of having the set of 60 numbers read into the EEPROM (via the DATA command). These numbers represent pin designations...basically it tells the STAMP which pin to listen to during the loop. This pin· number·plus 7 represents an output pin which lights up a corresponding set of LEDs. So during the first pass the LEDs attached to pin 10 should light up and the STAMP is "listening" to pin 3. This part seems to work fine, for the first 16 numbers...

The program runs through the first set of 16 numbers (3, 5, 3,....3, 2) and then repeats this sequence. It never gets to the next 44 numbers.

So I'm wondering if I have a goof in my syntax somewhere? There is a variable called "location" that informs the READ statement where to look in the memory. Is there some reason "location" isn't moving on to the 17th memory location?

Is there a better way to do this than how I have it structured?

Thanks in advance!

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-05-19 06:26
    Hi , try making location a byte variable.



    Jeff T.
  • R. KinslerR. Kinsler Posts: 5
    edited 2007-05-19 06:40
    Oh, man I can't believe I missed that. Thanks very much...I guess I was too tired to spot such a simple mistake. It works fine now, lol.

    I appreciate it!
    ·
Sign In or Register to comment.