Array memory limits
Posted: Mon Mar 30, 2015 8:36 am
I'm thinking about building a couple of mini-dataloggers for my race car. I'd like to log time, the analog output of a ride-height sensor, and maybe a measure of rpm using the PULSIN command (I've already made a quicky TACH using this command). With maybe 16K of RAM available to store data, I'm wondering how to allocate memory and how to estimate how quickly it will fill up.
For time, the simplest thing would be to DIM a string array. Since I know how long the string I'll be saving is, I could estimate how long an array I can fit into memory -- if I knew the particulars of the storage. Other BASIC's have a several byte overhead for strings; what is it for EZ-Basic?
The other signals I'd like to log are integers -- but there are no explicit integer array variables defined in the Programming manual. I suppose I could scale the numbers and store them as FP (10000 * TACH + RIDEHEIGHT, say) but I'd prefer to save each in a separate array. If I force the values to be integers [e.g. TACH(k) = INT(rpm)], will the values be saved as integers? How would this affect the RAM allocated when I DIM the array?
Finally, is there a PEEK or something I can use to find out how much free RAM I have?
Thanks,
Charles
For time, the simplest thing would be to DIM a string array. Since I know how long the string I'll be saving is, I could estimate how long an array I can fit into memory -- if I knew the particulars of the storage. Other BASIC's have a several byte overhead for strings; what is it for EZ-Basic?
The other signals I'd like to log are integers -- but there are no explicit integer array variables defined in the Programming manual. I suppose I could scale the numbers and store them as FP (10000 * TACH + RIDEHEIGHT, say) but I'd prefer to save each in a separate array. If I force the values to be integers [e.g. TACH(k) = INT(rpm)], will the values be saved as integers? How would this affect the RAM allocated when I DIM the array?
Finally, is there a PEEK or something I can use to find out how much free RAM I have?
Thanks,
Charles