only getting value 255 from EEPROM

UKHeliBob:

int val = Wire.read();

EEPROM.write(addr, val);



EEPROM.write() only writes 1 byte. An int is 2 bytes.
Do you see a problem ?

Have a look at the EEPROM.put() and EEPROM.get() functions

I have looked in to it and I get what you are saying, thats why I divided the integer values by 4 to get 1 byte (which is in the code ''the master side'') so EEPROM.write could send it.