Compass heading "freeze" when using MAG, ACC and GYR in same program

Home Forums Forums Technical Support for BerryIMU Compass heading "freeze" when using MAG, ACC and GYR in same program

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5862
    Sten-Helge
    Participant

    Hi there,
    When combining the code from “compass_tutorial02_tilt_compensation” and “gyro_accelerometer_tutorial03_kalman_filter”, the readings from the gyro seems to be as it should. However, the heading freeze.
    The interesting thing is that running the to programs separately in parallel goes well.
    Are there any pitfalls that I should be aware of when combining all registers in the same program.

    Thanks
    stenhh

    #5863
    Mark Williams
    Keymaster

    Have you enabled the magnetometer?

            //Enable the magnetometer
            writeMagReg( CTRL_REG5_XM, 0b11110000);   // Temp enable, M data rate = 50Hz
            writeMagReg( CTRL_REG6_XM, 0b01100000);   // +/-12gauss
            writeMagReg( CTRL_REG7_XM, 0b00000000);   // Continuous-conversion mode

    And are you reading the values every loop?
    readMAG(magRaw);

    If you still have issues, paste your code here so I can look further.

    Mark --OzzMaker.com --

    #5866
    Sten-Helge
    Participant

    Thanks for the prompt replay.
    A bit embarrassing – it turned out to be typo. Sorry for the inconvenience.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…