A way to store and read arrays to and from the EEPROM
Bobb Fwed
Posts: 1,119
I was asked a couple weeks ago by a forum member if my MSM object could store arrays, it can, but there is a limit of 256 bytes for reading a value, so if the stored array is longer, you must grab each element one by one. The 256 byte limit is arbitrary, only because there needed to be some limit and 64 longs seemed reasonable, this extra space must be built into the object's clearance to prevent potential errors.
Anyway, If you are looking to store arrays (of any length) and you don't need the many extra features of MSM, here is an object that allows you to store and access arrays of any length. It's 222 longs, though most of that comes from the I2C object, and my object could probably be optimized anyway, seeing as I just ganked the methods from MSM that I needed to make it work, with minimal modification.
I hope this helps others that may be in the same boat, those who just want to store a few values/arrays.
It also includes a DEBUG wrapper that I've built that I like for many different reasons (maybe I'll post both of these to the OBEX).
Anyway, If you are looking to store arrays (of any length) and you don't need the many extra features of MSM, here is an object that allows you to store and access arrays of any length. It's 222 longs, though most of that comes from the I2C object, and my object could probably be optimized anyway, seeing as I just ganked the methods from MSM that I needed to make it work, with minimal modification.
I hope this helps others that may be in the same boat, those who just want to store a few values/arrays.
It also includes a DEBUG wrapper that I've built that I like for many different reasons (maybe I'll post both of these to the OBEX).