if(Wire.available() == 7) // slave may send less than requested
{
byte seconds = Wire.read(); // receive a byte as character
byte minutes = Wire.read(); // receive a byte as character
byte hours = Wire.read(); // receive a byte as character
byte day = Wire.read(); // receive a byte as character
byte date = Wire.read(); // receive a byte as character
byte month = Wire.read(); // receive a byte as character
byte year = Wire.read(); // receive a byte as character
// Print date to serial port
Serial.print("Date: ");
Serial.print((month & 0x10)>>4);
Serial.print(month & 0x0F);
Serial.print("/");
Serial.print((date & 0x70)>>4);
Serial.print(date & 0x0F);
Serial.print("/");
Serial.print((year & 0x70)>>4);
Serial.print(year & 0x0F);
// Print time to serial port
Serial.print(" Time: ");
Serial.print(hours);
Serial.print(":");
Serial.print((minutes & 0x70)>>4);
Serial.print(minutes & 0x0F);
Serial.print(":");
Serial.print((seconds & 0x70)>>4);
Serial.print(seconds & 0x0F);
Serial.println("");
}