- December 16, 2016 at 3:14 am #5862Sten-HelgeParticipant
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.
stenhhDecember 16, 2016 at 10:25 am #5863Mark WilliamsKeymaster
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?
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-HelgeParticipant
Thanks for the prompt replay.
A bit embarrassing – it turned out to be typo. Sorry for the inconvenience.
- You must be logged in to reply to this topic.