I want to solve some problem. Interrupt does not work on arduino mega.

Hi
I'm making quadcopter with arduino mega.
after uploading source for copter and I open serial window at IDE to check if hardware is working or not.
But The copter is waiting DMP first interrupt and stop with below message
"Initializing I2C devices...
Testing device connections...
MPU6050 connection successful
Initializing DMP...
Enabling DMP...
Enabling interrupt detection (Arduino external interrupt 0)...
DMP ready! Waiting for first interrupt..."

I don't have idea where I'm modifying.
I think, it doesn't working below codes.

inline void initRC(){
  pinMode(RC_PWR, OUTPUT);
  digitalWrite(RC_PWR, HIGH);
  
  // FIVE FUCKING INTERRUPTS !!!
  PCintPort::attachInterrupt(RC_1, rcInterrupt1, CHANGE);
  PCintPort::attachInterrupt(RC_2, rcInterrupt2, CHANGE);
  PCintPort::attachInterrupt(RC_3, rcInterrupt3, CHANGE);
  PCintPort::attachInterrupt(RC_4, rcInterrupt4, CHANGE);
  
}

the attached file is source code.

dronixcopter.ino (15.1 KB)

Is this a program you wrote yourself?

What is your level of programming experience?

...R

You need to read up on the mega's interrupts. Only certain pins can be used, and there is a recommended way to attach them.
https://www.arduino.cc/en/Reference/AttachInterrupt

Robin2:
Is this a program you wrote yourself?

What is your level of programming experience?

...R

No it is written by someone I just download it from his blog and I can't touch him.

SurferTim:
You need to read up on the mega's interrupts. Only certain pins can be used, and there is a recommended way to attach them.
attachInterrupt() - Arduino Reference

Yeah I know that. I use D2 pin for gy-86 as interrupt. and it is include PinChangeInt.h.
Because of changing D8/9/10/11pin to use interrupt.

I don't know. Maybe it's just my understanding of the datasheet.

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.

https://www.arduino.cc/en/Main/arduinoBoardMega2560

YeunhoKim:
No it is written by someone I just download it from his blog and I can't touch him.

Perhaps it would be wise to start learning about Arduinos with a less complex project?

...R

The pin change interrupts on the Mega are a completely different arrangement from on the Uno/Mini.

Any code using them cannot be ported between the different processors.