Home › Forums › Forums › Technical Support for BerryIMU › Compass heading "freeze" when using MAG, ACC and GYR in same program
Tagged: kalman filter, tilt compensation
- This topic has 2 replies, 2 voices, and was last updated 6 years, 9 months ago by Sten-Helge.
- AuthorPosts
- December 16, 2016 at 3:14 am #5862Sten-HelgeParticipant
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
stenhhDecember 16, 2016 at 10:25 am #5863Mark WilliamsKeymasterHave 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 --
December 17, 2016 at 2:22 am #5866Sten-HelgeParticipantThanks for the prompt replay.
A bit embarrassing – it turned out to be typo. Sorry for the inconvenience. - AuthorPosts
- You must be logged in to reply to this topic.