Need Help with I2C EEPROM

I'm trying to write to an EEPROM a number and then retrieve it.

I'm seeing some strange behavior.

When reading the value I get 255, but I was trying to write the number 12.

This was meant to be a small example of what I ultimately want to do, but it doens't seem to work correctly. I cannot see where the problem is with my code.

(My end goal is to be able to write in location 0 and 1 a "program" length [greater than 255] and then from 2-on write values between 0-255..but I need to be able to successfully write and retrieve first!)

Thanks for taking the time to review this!

#include <Wire.h>

#define disk1 0x50    //Address of 24LC256 eeprom chip

int runOnce = 0;


void setup(void)
{
  Serial.begin(9600);
  if (!Serial)
  {
  }
  Wire.begin();

}

void loop() {

  unsigned int address = 0;

  if (runOnce == 0) {
    //write to disk1 (eeprom addr), address (mem location on EEPROM), data
    writeEEPROM(disk1, address, byte(12));
    delay(15);
  
    Serial.print(readEEPROM(disk1, address), DEC);
    runOnce = 1;
  }
}

void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data )
{
  Serial.println("in write eeprom \n");
  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress >> 8));   // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
  Wire.write(data);
  Wire.endTransmission();
  delay(5);
}

byte readEEPROM(int deviceaddress, unsigned int eeaddress )
{
  byte rdata = 0xFF;

  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress >> 8));   // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
  Wire.endTransmission();

  Wire.requestFrom(deviceaddress, 1);

  if (Wire.available()) rdata = Wire.read();

  return rdata;
}

BTW I am using an Adafruit Feather 900hz M0 board, but also prototyping on an UNO....I noticed it worked with the UNO (both at 5v and 3.3v) when I removed the pullup resistors from SCL & SDA.

Could it be a pullup resistor value when using the Adafruit Feather 900hz M0 board?

Again, any help would be appreciated!

From what I understand, the feather MO i2c bus does not have pullups enabled and you will need external pullups to 3.3v.

#20 / SDA - GPIO #20, also the I2C (Wire) data pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup.
#21 / SCL - GPIO #21, also the I2C (Wire) clock pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup.

@cattledog I read the link you provided. I had tried the 10kohm previously and it didn't work for me.

Since the article mentioned 2.2k-10k I figured I'd try the 2.2kohm....AND IT WORKED!!

Thank you so much!!