Tilt Compensated eCompass, no FPU

This is a software eCompass library which requires use of a Freescale accelerometer and magnetometer

Hello World

Import programKL46_eCompass

This program uses the MMA8451 & MAG3110 on a KL-46 freedom board to implement a tilt compensated eCompass with the heading displayed on the LCD. This program uses the mbed RTOS to manage the hard real time requirements of the eCompass algorithm


Import libraryeCompass_Lib

Improved eCompass with support for different sensor options and a new C++ wrapper


This example runs on a KL46 Freedom board using the on board MMA8451Q accelerometer and MAG3110 magnetometer. Optionally it can be used with the FXOS8700 combination accelerometer / magnetometer on a Freescale FRDM-FRS-MULTI shield.

The library output includes calibrated magnetometer values, Euler angles and Quaternions.

The object library has been compiled for a Cortex M0+ CPU and may only be used with Freescale sensors.

For source code for the eCompass library please contact your local Freescale representative

Please log in to start a discussion or ask a question.