Yeah, the problem is that anything that relies on interrupts is going to be in conflict with all the video interrupts. The timing gets screwed up. During the vertical blanking interval (at the end of each frame) there is a period of time when interrupts are not firing, so you can do your I2C communication then. Create a function that sets a flag indicating that we are in VBI. Then register that function to be called at the beginning of VBI.
void setVBIFlag() {
inVBI = true;
}
In your sketch setup, register this function:
tv.set_vbi_hook(&setVBIFlag);
Now, in your sketch main loop you can communicate with the compass like this:
if (inVBI) {
// communicate with compass here
inVBI = false; // reset the flag so we only try to communicate once per frame
}
I hope that makes sense. The interrupt driven nature of TVout makes this tricky. I had to do this when I communicated with a Nunchuk with my Hackvision product. You may also run into memory constraints because the I2C library is very bloated memory-wise. I trimmed it down in the Hackvision Controllers library, so you can take a look at that:
http://nootropicdesign.com/hackvision/downloads/Controllers.zip