Quick question concerning Variables and arrays
kingspud
Posts: 128
Hello all,
I have a quick questions concerning variable and arrays!
I need an array that will total 60 cells and take a number of either 0 or 1
and I need an array that will by 11 cells and take a number from 1 to 10!
Can some one please write out the correct format, ie;·
number··· var··· nib(30)
thanks
Also, I keep running out of space due to large variables so does anyone know how many byte arrays can be used in the BS2px24 chip?
Joe
I have a quick questions concerning variable and arrays!
I need an array that will total 60 cells and take a number of either 0 or 1
and I need an array that will by 11 cells and take a number from 1 to 10!
Can some one please write out the correct format, ie;·
number··· var··· nib(30)
thanks
Also, I keep running out of space due to large variables so does anyone know how many byte arrays can be used in the BS2px24 chip?
Joe
Comments
In direct answer to your question the first array would look like this:
Arrray1 VAR BIT(60) '60 bit (one bit per cell) array referenced 0-59
The second array would look like this:
Array2 VAR NIB(11) '11 nib (4-bits per cell) array referenced 0-10
The BS2-P24 (there is no BS-2PX24 to my knowledge) has 26 BYTES of RAM and 128 BYTES of scratchpad RAM. You can use that RAM any way you choose: BITS, NIBS, BYTES or WORDS. If you meant the BS-2PX, the answer is the same as the BS-2P24.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Actually there is a BS2px24...
BASIC Stamp 2px 24-Pin Module
<!-- unit price -->http://www.parallax.com/detail.asp?product_id=BS2PX24
This is the one I was talking about...·
Thanks for the info concerning the arrays, it clears things up!!
Joe
That will teach me to beleive what I read here on the forum
That's the only PBASIC Stamp model that I don't own, thus I'd never actaully looked at the ordering page. Glad the information was helpful.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I have just posted a the WIP - project dealing with the variable concerns and maybe someone can take a look at it and figure out what I am doing wrong!
The new post is: Need help in completing this project and streamlining the code! 10 LED bargraph mulitstate settings··in the basic stamp forum!
thanks for all your help
Joe