how many variables can one create?

tarantulataramasalata

Senior Member
I'm doing a project and I want to know how many variables I can create. I plan to use readadc and store a sequence of values into a corresponding sequence of variables, and then create a specific output combination depending on those variables.

I would also like to store these variables so they remain after the picaxe turns off, and I think I need to use a eeprom in combination with the picaxe- any pointers to suitable products/tutorials for this much appreciated.
 

womai

Senior Member
Using variables for that task may not be the best solution. The Picaxes have only 14 byte variables (b0 .. b13) but unlike the basic stamps doesn't have the option of accessing them as an array indexed by a counter. (you can of course use the trick that b0 is at address 50 (0x32), b1 at 51 etc. and use peek/poke to use them as an array).

A better way would be to store them either in the additiona RAM or the user accessible EPROM. The first is accessed through peek/poke, the latter through read/write. Refer to the Picaxe Basic manual for details, it also tells you which range of addresses is available - depends on the specific Picaxe type you are using. On the X parts, the EPROM size is either 128 or 256 bytes. If you need more, you'll have to use an external EPROM, preferably one with I2C access. The Picaxe I2C manual gives more details.

Wolfgang
 
Top