What is your favorite I2C compass module?

I am working on adding compass support to the upcoming v0.87 libaries for RoboPi.


Currently, I am adding support for HMC6352 and HMC5883L based I2C compass modules in the upcoming v0.87 version of the firmware and libraries.

Two new API calls will be added:

int initCompass(int model, int offset) // model = HMC6352 | HMC5883, offset = difference between true north and magnetic north at current location

int getHeading() // returns 0-359 degrees, -1 means error / not initialized

I don't see any point in supporting fractional degrees, the accuracy of these modules is really only about 2 degrees anyway.

I will consider adding other popular inexpensive compass modules in the future, don't be shy about letting me know which are your favorites (please provide links)

Thank you

I will look into the CMPS10, and see if I should add it.

Compass math

Keep it simple!!! If I want filtering, I want to control the time domain as well as the sample count. I also wouldn’t want simple averaging. Just my $0.02 worth.


I’ll make a simple read raw available, so users can filter as they like.