Shop OBEX P1 Docs P2 Docs Learn Events
Large array in SPIN — Parallax Forums

Large array in SPIN

donnpangydonnpangy Posts: 49
edited 2013-09-30 21:39 in Propeller 1
Hello,
I am looking to set up a large array in spin. I am looking to set up an array with at least 2000 longs.

It seems to crash if I set up an array over 1000 longs. I am sure it is something simple that I am doing wrong, or something that I am leaving out.
Any suggestions would be appreciated.
Thanks,
Don



VAR
long SERVOstack[900]


cognew(MAIN,@SERVOstack)

PUB MAIN | X, Y, Z, LED[2000]

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-09-30 21:33
    I'm pretty sure your stack needs to include the local variables. Easiest fix is to make your LED array global. Alternately (but not a good alternative) make your stack larger than the array (don't do this though, make your array global).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-30 21:39
    I agree with Duane. Put LED[2000] in the VAR section.

    -Phil
Sign In or Register to comment.