RTC I2C doesn't use a4 and a5

Hi, in my project i want to use the rtc shield (ds1307) on an Arduino mega. I know that the 12c pins of the arduino uno are a4 and a5, so i have build a shield that connect a4 and a5 to 20 and 21 of the arduino mega. I tried to use the example sketch of the rtc but it doesn't worked. So after some minutes, i saw that the pins used from the rtc shield are sda and scl (above gnd and aref). There are some way to use a4 and a5, because between the arduino mega and the rtc shield i have to put the ethernet shiled, that hasn't the pins above gnd and aref

You should post your code and the library you are using. I use I2C devices on my Mega without a problem.

You should stack the shields as follows:

Ethernet shield
RTC shield
Arduino Mega

Insure the ethernet shield has a connection to the ICSP pins on the Mega. Those are the SPI data/clock lines.

ok, thanks.