dmp ready waiting for interrupt no inturrupt

I have this code that I have modified and am having one problem with it. It will compile but when I go to serial monitor it says its waiting for interrupt and never gets one. The code get to servo angles from two different MPU6050 sensors. I have got this code to work before but it crashed somehow and when I found it it didn’t work and I couldn’t find an older copy. The wiring also doesn’t have a interrupt pin and didn’t need one before either. I have tried getting rid of the interrupt section of code and it didn’t do anything either. I know it will be a fairly simple fix if someone could help that would be much appreciated.

#include "I2Cdev.h"

#include "MPU6050_6Axis_MotionApps20.h"

#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
#endif

#include <Servo.h>

Servo myservo1;
Servo myservo2;

MPU6050 mpu1(0x68);
MPU6050 mpu2(0x69);

#define OUTPUT_READABLE_YAWPITCHROLL

int16_t ax1, ay1, az1;
int16_t gx1, gy1, gz1;

int16_t ax2, ay2, az2;
int16_t gx2, gy2, gz2;

#define LED_PIN 13
bool blinkState = false;
bool attInt = false;

// New Stuff 
long unsigned currentTime = 0;
long unsigned counter = 0;
boolean flip = true;

//


// MPU control/status vars
bool dmpReady1 = false;  // set true if DMP init was successful
uint8_t mpuIntStatus1;   // holds actual interrupt status byte from MPU
uint8_t devStatus1;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize1;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount1;     // count of all bytes currently in FIFO
uint8_t fifoBuffer1[64]; // FIFO storage buffer
bool dmpReady2 = false;  // set true if DMP init was successful
uint8_t mpuIntStatus2;   // holds actual interrupt status byte from MPU
uint8_t devStatus2;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize2;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount2;     // count of all bytes currently in FIFO
uint8_t fifoBuffer2[64]; // FIFO storage buffer

// orientation/motion vars
Quaternion q1;           // [w, x, y, z]         quaternion container
VectorInt16 aa1;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal1;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld1;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity1;    // [x, y, z]            gravity vector
float euler1[3];         // [psi, theta, phi]    Euler angle container
float ypr1[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
Quaternion q2;           // [w, x, y, z]         quaternion container
VectorInt16 aa2;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal2;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld2;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity2;    // [x, y, z]            gravity vector
        // [psi, theta, phi]    Euler angle container
float ypr2[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector



// ================================================================
// ===               INTERRUPT DETECTION ROUTINE                ===
// ================================================================

volatile bool mpuInterrupt1 = false;     // indicates whether MPU interrupt pin has gone high
volatile bool mpuInterrupt2 = false;     // indicates whether MPU interrupt pin has gone high
void dmpDataReady1() {
    mpuInterrupt1 = true;
}

void dmpDataReady2() {
    mpuInterrupt2 = true;
}


void setup() {
// join I2C bus (I2Cdev library doesn't do this automatically)
Wire.begin(); 
TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz)
//Fastwire::setup(400, true);

// initialize serial communication
// (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
// it's really up to you depending on your project)
Serial.begin(38400);

// initialize device
Serial.println("Initializing I2C devices...");
//accelgyro.initialize();
mpu1.initialize();
mpu2.initialize();

// verify connection
Serial.println("Testing device connections...");
Serial.println(mpu1.testConnection() ? F("MPU6050-1 connection successful") : F("MPU6050-1 connection failed"));
Serial.println(mpu1.testConnection() ? F("MPU6050-2 connection successful") : F("MPU6050-2 connection failed"));

    // wait for ready
  /*  Serial.println(F("\nSend any character to begin DMP programming and demo: "));
    while (Serial.available() && Serial.read()); // empty buffer
    while (!Serial.available());                 // wait for data
    while (Serial.available() && Serial.read()); // empty buffer again
*/
    // load and configure the DMP
    Serial.println(F("Initializing DMP..."));
    devStatus1 = mpu1.dmpInitialize();
    devStatus2 = mpu2.dmpInitialize();

    // supply your own gyro offsets here, scaled for min sensitivity
    mpu1.setXGyroOffset(220);
    mpu1.setYGyroOffset(76);
    mpu1.setZGyroOffset(-85);
    mpu1.setZAccelOffset(1788); // 1688 factory default for my test chip
    mpu2.setXGyroOffset(220);
    mpu2.setYGyroOffset(76);
    mpu2.setZGyroOffset(-85);
    mpu2.setZAccelOffset(1788); // 1688 factory default for my test chip

    // make sure it worked (returns 0 if so)
    if (devStatus1 == 0 && devStatus2 == 0) {
        // turn on the DMP, now that it's ready
        Serial.println(F("Enabling DMP..."));
        mpu1.setDMPEnabled(true);
        mpu2.setDMPEnabled(true); 

        // enable Arduino interrupt detection
        Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
      attachInterrupt(0, dmpDataReady1, RISING); // *** MOVED FROM SETUP TO LOOP
      attachInterrupt(1, dmpDataReady2, RISING); // *** MOVED FROM SETUP TO LOOP
        mpuIntStatus1 = mpu1.getIntStatus();           
        mpuIntStatus2 = mpu2.getIntStatus();   

        // set our DMP Ready flag so the main loop() function knows it's okay to use it
        Serial.println(F("DMP ready! Waiting for first interrupt..."));
        dmpReady1 = true;
        dmpReady2 = true;
        
        // get expected DMP packet size for later comparison
        packetSize1 = mpu2.dmpGetFIFOPacketSize();        
        packetSize2 = mpu2.dmpGetFIFOPacketSize(); 
            } else {
        // ERROR!
        // 1 = initial memory load failed
        // 2 = DMP configuration updates failed
        // (if it's going to break, usually the code will be 1)
        Serial.print(F("DMP Initialization failed (code "));
        Serial.print(devStatus1);
        Serial.print("\t");
        Serial.print(devStatus2);
        Serial.println(F(")"));
    }

                 

// configure Arduino LED for
    pinMode(0, INPUT); // *** ADDED FROM ORIGINAL CODE
    pinMode(1, INPUT); // *** ADDED FROM ORIGINAL CODE  
pinMode(LED_PIN, OUTPUT);
}

cghcj

second half if needed

void loop() {

    

    // if failed
    if (!dmpReady1 || !dmpReady2 ) return;

       // wait for MPU interrupt
   while (!mpuInterrupt1 && fifoCount1 < packetSize1 && !mpuInterrupt2 && fifoCount2 < packetSize2) {
        // other program behavior stuff here
        // .
        // .
        // .
        // if you are really paranoid you can frequently test in between other
        // stuff to see if mpuInterrupt is true, and if so, "break;" from the
        // while() loop to immediately process the MPU data
        // .
        // .
        // .
    }

    mpuInterrupt1 = false;     // indicates whether MPU interrupt pin has gone high
    mpuInterrupt2 = false;     // indicates whether MPU interrupt pin has gone high
    mpuIntStatus1 = mpu1.getIntStatus();
    mpuIntStatus2 = mpu2.getIntStatus();    

    fifoCount1 = mpu1.getFIFOCount();
    fifoCount2 = mpu2.getFIFOCount();

    // check for FIFO overflow 
    if ((mpuIntStatus1 & 0x10) || fifoCount1 == 1024) {
        // reset so we can continue cleanly
        mpu1.resetFIFO();
        Serial.println(F("Malfunction"));

    // else check for DMP data ready interrupt
    } else if (mpuIntStatus1 & 0x02) {
        // wait for corrrect data length
        while (fifoCount1 < packetSize1) fifoCount1 = mpu1.getFIFOCount();

        // read a packet from FIFO
        mpu1.getFIFOBytes(fifoBuffer1, packetSize1);
        
        // track FIFO count here in case there is > 1 packet available bypassing interrupt
        fifoCount1 -= packetSize1;

             #ifdef OUTPUT_READABLE_YAWPITCHROLL
            // display Euler angles in degrees
            mpu1.dmpGetQuaternion(&q1, fifoBuffer1);
            mpu1.dmpGetGravity(&gravity1, &q1);
            mpu1.dmpGetYawPitchRoll(ypr1, &q1, &gravity1);
            Serial.print("ypr1\t");
            Serial.print(ypr1[0] * 180/M_PI);
            Serial.print("\t");
            Serial.print(ypr1[1] * 180/M_PI);
            Serial.print("\t");
            Serial.println(ypr1[2] * 180/M_PI);
            myservo1.write(180-(90+ ypr1[2] * -180/M_PI));
        #endif
    }
    
    if ((mpuIntStatus2 & 0x10) || fifoCount2 == 1024) {
        // reset so we can continue cleanly
        mpu2.resetFIFO();
        Serial.println(F("Malfunction on 2"));

    // else check for DMP data ready interrupt
    } else if (mpuIntStatus2 & 0x02) {
        // wait for correct available leangth
        while (fifoCount2 < packetSize2) fifoCount2 = mpu2.getFIFOCount();

        // read a packet from FIFO
        mpu2.getFIFOBytes(fifoBuffer2, packetSize2);
        
        // track FIFO count here in case there is > 1 packet available bypassing interrupt
        fifoCount2 -= packetSize2;

            // angles in degrees
            mpu2.dmpGetQuaternion(&q2, fifoBuffer2);
            mpu2.dmpGetGravity(&gravity2, &q2);
            mpu2.dmpGetYawPitchRoll(ypr2, &q2, &gravity2);
            Serial.print("ypr2\t");
            Serial.print(ypr2[0] * 180/M_PI);
            Serial.print("\t");
            Serial.print(ypr2[1] * 180/M_PI); 
            Serial.print("\t");
            Serial.println(ypr2[2] * 180/M_PI);
            myservo2.write(180-(90+ ypr2[2] * -180/M_PI));
    }
   

// blink LED to indicate activity
blinkState = !blinkState;
digitalWrite(LED_PIN, blinkState);
}