Problem for reading and writting I2C Eeprom 24c02 6

In the writeData function you must not use Wire.endTransmission(1);
It must be either Wire.endTransmission(); or Wire.endTransmission(0);

You only use (1) when doing a read - in between writing the address and then issuing the requestFrom.

Pete