Multi-dimensional array in eeprom

OK, I have been thinking about how to keep my code hidden, yet let people edit parameters within it.

Basically, I have a multi-dimensional array of numbers, and I was thinking, could I possibly write these to eeprom, and have the code retrieve them?

The way I am thinking is, I can make a simple program that will allow people to write to the eeprom, so I don't have to give out source code.

I'm just wondering, how I would go about writing/reading a multi-dimensional array to/from eeprom? Any suggestions/ideas?

Cheers,
Dan :slight_smile:

I'm just wondering, how I would go about writing/reading a multi-dimensional array to/from eeprom?

One byte at a time.
Just define the number of rows / columns / planes etc and the size of the elements - the rest is simple arithmetic.

Sorry if this is stupidly obvious, though I'm really new to arrays.

This is my array here

byte array[3][10] = {
  {36, 41, 43, 44, 46, 48, 49, 51, 53, 55},    
  {35, 47, 54, 55, 57, 59, 60, 61, 62, 64},    
  {48, 60, 62, 63, 65, 67, 69, 70, 72, 74}    
};

The way I think of doing it seems kind of long-winded, like

byte array[3][10] = {
  {eeprom.read(1), eeprom.read(2), eeprom.read(3), ....};
};

I think there is a much faster way of doing this?

Cheers,
Dan

I think there is a much faster way of doing this?

There is. Look at for loops.

Quote
I think there is a much faster way of doing this?
There is. Look at for loops.

Not sure "for" loops are any faster, but they sure are more succinct/flexible.
I second the "look at for loops"