What type of interrupt is used for the Wire.onReceive function?

Hi, I've been doing a bit of research into how my Arduino uno handles interrupts and it looks like it only has two types available: pinchange and external. External interrupts only work on pins 2 and 3 while a pinchange interrupt will be engaged (to my knowledge) whenever the pin changes state ie a rising or falling edge. But, when interfacing two Arduinos together with I2C I can get the function Wire.onReceive to interrupt my code without using either type of interrupt. How is this achieved?

There are timer interrupts, too.

But, when interfacing two Arduinos together with I2C I can get the function Wire.onReceive to interrupt my code without using either type of interrupt.

How do you know that? Obviously, external interrupts aren't used, since the I2C pins are not external interrupt pins.

Ishmael123:
Hi, I've been doing a bit of research into how my Arduino uno handles interrupts and it looks like it only has two types available: pinchange and external. External interrupts only work on pins 2 and 3 while a pinchange interrupt will be engaged (to my knowledge) whenever the pin changes state ie a rising or falling edge. But, when interfacing two Arduinos together with I2C I can get the function Wire.onReceive to interrupt my code without using either type of interrupt. How is this achieved?

Read a little deeper in the Atmel datasheet. Here is a list of the hardware interrupts on the Atmel ATmega328P:

Only vector 2 and 3 are accessible via AttachInterrupt(). The rest are used in libraries.

If you want an easy way to use the PinChange interrupts check out GreyGnome's EnableInterrupt library

Chuck.

Sorry, I was mistaken in my premise. Wire.onReceive is not actually interrupting my code at all I simply made a different mistake in my code. But thank you for the responses!