have i fried my arduinos i2c connection?

Im connecting raspberry pi to arduino through i2c. It worked fine but suddenly it stopped working and I am afraid something have happened to the arduino.

I have connected:

(Pi) SDA -> SDA (Arduino)
(Pi) SCL -> SCL (Arduino)
(Pi) Ground -> Ground (Arduino)

But when I am running

sudo i2cdetect -y 1

suddenly it returns blank:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

When I am connecting another sda device to the pi it however gets detected so there is nothing wrong with the pi.

Is there a possibility I can have fried the arduino?

It however gets detected and I if I upload a simple sketch to it for blinking it works with no problem on both sda 20 and scl 21 pin. It is just the i2c who doesnt get detected anymore

I have also written a simple sketch to display the input value from 20 and 21 on my mega (SDA and SCL).

void setup(){
Serial.begin(9600);
pinMode(,INPUT);
digitalWrite(20,HIGH); // turn on internal pullup resistor
pinMode(21,INPUT);
digitalWrite(21,HIGH); // turn on internal pullup resistor
Serial.println("Booted");
}

void loop(){
static bool pin20=LOW;
static bool pin21=LOW;

if(pin20!=digitalRead(20)){
  pin20 = !pin20;
  Serial.print("20=");
  Serial.println(pin20);
  }
if(pin21!=digitalRead(21)){
  pin21 = !pin21;
  Serial.print("21=");
  Serial.println(pin21);
  }
}

this returns 0 when when I connect pin to the ground and 1 if not so the input does not seem to be fried or can it be that anyway? Any other way to test arduinos sda and scl?

What else can I check?

Ah stupid mistake. It works now again. I noticed that it is NOT enough to have the arduino connected for it to get recognized by the pi. I have to CONNECT something to the arduino as well. As soon as I connected the arduino to for example a led it works as expected

There should not be a need to connect anything to your Mega for it to be able to communicate with the Pi over I2C; it obviously needs power :wink:

You however need a ground connection between Mega and Pi; it's not sufficient to just connect SDA and SCL.
That ground connection can be the USB between the Mega and the Pi.

Also be aware that the Mega is a 5V device and the Pi, to my knowledge, a 3.3V device. I don't know if the Pi's inputs are 5V tolerant, but if not you might damage the Pi.