Does 'digitalPinToInterrupt' work with analog pins I have an interrupt signal attached to the A12 pin of an Arduino Mega 2560.

Would the following source line activate the interrupt processing?  I am calling the digitalPinToInterrupt function on an Analog pin.  It compiles fine.



attachInterrupt(digitalPinToInterrupt(A12), MessageFromIOBInt, FALLING);


where my interrupt code is 

void MessageFromIOBInt(void) {
    ++gNumInterrupts;
}
Interrupts only work on interrupt pins. Trying to translate a pin number into an interrupt number for a pin that isn't an interrupt pin will never work.


  External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a low level, a rising or falling edge, or a change in level.


Many pins (including the analog pins) can use the pin change interrupt. This requires an external library which has its own way of interfacing with them (see the examples).