Which library to use for SDA1 and SCL1 (second I2C) Arduino Due

rdata is an array. Serial.write(array, length) will write (not print) the requested number of bytes from that array location.

This line say readEEPROM from disk1

// read back the data 28 bytes at a time
  // reading data doesn't suffer from the page boundary rules
  Serial.println("DATA READ");
  for (i = 0; i < 10; i++) {
    readEEPROM(disk1, (i * 28), rdata, 28);
    Serial.write(rdata, 28);
  1. how do I Serial.print this?
  2. what is the function of ‘Serial.write(rdata, 28);’ Where does it write too? {if it writes to the serial port why can’t I see it?}

Thanks in advance

If you are on a Due then Serial refers to the programming port. I use that port very rarely. I use the native port and SerialUSB.

Your data is a string. write() is the correct method to use.

This is what I get when I try to print:

I managed to track down the fault. The delay(6) is to short. I changed it to delay(10) and Serial.print gave me this:

The data is empty. You get 10 zeroes printed because the first item in the rdata[] array is zero and you used Serial.print(*rdata); (*rdata is equivalent to rdata[0])

So is the eeprom empty or did you fail to read? Try to put some more debugging in the write function, to check it is doing what you expect and the eeprom is responding.

A byte has 8 bits and it can only represent a value between 0 and 255