For one user it works perfect, but when I add more user it doesn´t work. I believe the problem is in the setup while reading the EEPROM the way I show in the code. Is it wrong to write "EEPROM.read(i+5);"?? Is the way I tought to write all my users codes in EEPROM. Anny suggestion of how to do it properly?

By doing "EEPROM.write(u*5," you write one number i one byte?? I mean, byte0 = '6', byte1='7', byte2 = '2'...??

With "read" I mean extract data from EEPROM, read the values of the EEPROM and assign it to my users list.

The idea is to not declare the users code numbers in the flash memory (because the users can be modify by sms), just write it once in EEPROM (by the way you teach me) and then delete the part of the code that writes in EEPROM and load the program in the Arduino again. So each time the program runs the first thing to do is read the values of the EEPROM and assign it to my users list. I made it like this (example for 3 users):

for(i=0; i<5; i++){ user1[i]=EEPROM.read(i); user2[i]=EEPROM.read(i+5); user3[i]=EEPROM.read(i+10);}With "doesn't work" I mean that the keypad did not recognize the codes. At first I tried just with one user and the keypad recognize it

The value in u is multiplied by 5, so that the address being written to is 0, 5, 10, 15, etc.

It should, of course, be u*5 + b, so that the inner loop is writing to 0, 1, 2, 3, and 4 when u is 0, and to 5, 6, 7, 8, and 9, when u is 1.

And, of course, there is a ) missing on the end...

Quote

I made it like this (example for 3 users):

That should work, if the data is written correctly. So, add Serial.print() statements to see what is being read, what is being assigned to user1, etc. Don't forget that strings need to be NULL terminated, and yours are not (yet), if you are using them as strings, rather than just arrays of chars.

Yes, this method for 100 user is going to be crazy but at least it works. Next step is to receive sms and modify the EEPROM data if it is neccesary. Then I'll proceed to optimize the code, is insane right now!

for(byte u=0; u<userCount; u++){ for(byte b=0; b<5; b++) { EEPROM.write(u*5+b, user[u][b]); }}to store the data, you can use a similar set of loops to read the data.

I'd suggest that you also store the user count in EEPROM, so you have a way of knowing how many users there are. Perhaps write that in address 0, and add a +1 to all the EEPROM.write() addresses, to not overwrite that value.

I'll do it for sure. There is part of the code where I need to save array elements to EEPROM that don't know at the begining cause it arrive to my arduino via sms. For example an sms that sends me a text with the code "67202" I want to save the first element in byte 10, second one in byte 11... I tried like the next code show but it prints me in the serial "93" instead of 7. Do you know what i'm doing wrong?

The code (snippet) does something. "It doesn't work" only means that what it does is not what you want, without defining either what it does OR what you want.

You need to store all 5 characters, don't you?

Knowing where to store them is important. That's why I suggested storing the number of users in 0, so that you could read and update that number if a new user needs to be added. You could also use the number of users to determine the next available address to write to.