Lucian_Primarch

Member Since: February 16, 2013

Country: United States

  • You can change the Interrupt pin, use an Arduino Pin out map, see: http://playground.arduino.cc/Code/Interrupts http://arduino.cc/en/Main/arduinoBoardNano (if you are using a nano) or google images comes up with nice picture layouts.

    However I just changed the code and skip the interrupt pin all together, frees up a pin and I noticed if there are too many interrupts it can cause the MCU to lock up. Remove this:

    // wait for MPU interrupt or extra packet(s) available
    while (!mpuInterrupt && fifoCount < packetSize) {
        // 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
        // .
        // .
        // .
    }
    

    You have to leave the rest of the interrupt code in as the library calls use it, however it "tricks" it out into a continuous read from the sensor.

  • its because you are missing I2C.ino from: https://github.com/TKJElectronics/KalmanFilter/blob/master/examples/MPU6050/I2C.ino

    The only issue is it was written as a sketch and not a library.
    Easy solution copy paste Line(s): 18 - 63 of I2C.ino into the MPU6050.ino (re-arrange to look pretty if you want) and compile, it worked for me. Better Solution would be to convert I2C.ino into a library for general use.

  • I assume you are using Jeff Rowberg's code.

    The offsets can be applied in either the Arduino sketch, for example after you obtain Yaw, Pitch, and Roll: mpu.dmpGetYawPitchRoll(ypr, &q, &gravity); // Add Offset Constants to respective MPU6050 updated DMP Yaw/Pitch/Roll Value(s) ypr[YAW] += Yaw_Offset; // <-- note this is in radians ypr[PITCH] += Pitch_Offset; // <-- note this is in radians ypr[ROLL] += Roll_Offset; // <-- note this is in radians

    (above) this is the smarter way to do it as you may have multiple sensors and each sensor will need its own offset value, as they all vary.

    If you want a different way to do it but not have to see it in your code you could alter MPU6050_6Axis_MotionApps20.h -> dmpGetYawPitchRoll and add your offsets to data[0], data[1], data[2]. However I do not recommend this way, if you buy another identical sensor the offsets will be different.

No public wish lists :(