on
2021-10-22
2:45 AM
- edited on
2026-03-11
5:35 AM
by
Laurids_PETERSE
Among the wide portfolio of ST sensors, the E-Compass is a proof of a well-done sensor integration. This library acquires data from the accelerometer and magnetometer and provides information about the device orientation and movement status based on data from a device, merging the contribution of the magnetometer (i.e. the orientation with respect to the Earth's magnetic field) and the object movement detected by the accelerometer. Both sensors are physically in the same package.
In more details, MotionEC algorithm provides the following outputs:
the MotionEC library acquires data from the accelerometer and magnetometer and provides information about the device orientation and movement status based on data from a device.
The central function that runs the E-Compass algorithm (accelerometer and magnetometer data fusion) is the following one:
void MotionEC_Run(MEC_input_t *data_in, MEC_output_t *data_out)
where the input data are:
and the output data are:
See below an example of the output of MotionEC library in Unicleo-GUI framework :fast_down_button:
User Manual 2225 Getting started with MotionEC real-time E-Compass library in X-CUBE-MEMS1 expansion for STM32Cube