Arduino I2C Interrupt handler

Hello all. I was wondering if someone could please direct me to the right direction. i'm using the wire library to communicate using I2C between two Arduino unos. I was wondering if its possible to create an interrupt handler when either PIN 4 or 5 are pulled down. Thanks in advanced.

I was wondering if its possible to create an interrupt handler when either PIN 4 or 5 are pulled down.

There is the possibility to use the pin change interrupt for these pins. I never tried if that's active in I2C mode too but in any case, I don't think this makes sense. If you do anything more than a simple counter you probably break the I2C functionality anyway.
I also see absolutely no need for such an interrupt.

Try this to know more about interrupts: Gammon Forum : Electronics : Microprocessors : Interrupts

Try this for I2C: Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino

Gautam

Could you please direct a source on how "use the pin change interrupt for these pins". I'm using SoftI2CMaster library to communicate with temperature sensor with Arduino 1. and using the main I2C bus to have the Arduino 2 request information from the Arduino 1 with sensors. I don't mind the bus is bricked for some period of time as long I can switch it back after the interrupt goes off. Thanks for your reply.

Please go through the link for interrupts above, that shall help you get a headstart for the pins you want ( 4 & 5).

I don’t mind the bus is bricked for some period of time as long I can switch it back after the interrupt goes off.

This sounds like you’re trying to replace all four wheels on a car by square plates and then fill the edges with smaller rectangle plates to make the whole thing rounder again.

Post a description of your project and probably the code you currently use. Describe what you want to achieve, I’m quite sure we’ll find a better solution than what you’re currently trying to build.