04-16-2022 01:05 PM
Hi,
the datasheet of BMM150 (rev. 1.4) states in chapter "8.2 Sensing axis orientation":
"A remapping of the axes orientation is possible via API."
Wonder which functions is available to do so? Could not find any function for.
Was looking into File bmm150.c, Date 12 Sep 2017, Version 1.0.0 from Bosch Sensortec GmbH
Appreciate any hint.
regards
Stefan
04-18-2022 09:25 AM
Hi spachner,
For example:
BMM150 had default sensing axis orientation(black color in picture), device also had sensing axis orientation(red color).
For BMM150 itself:
struct bmm150_mag_data
{
/*! compensated mag X data */
float x;
/*! compensated mag Y data */
float y;
/*! compensated mag Z data */
float z;
};
/*! Structure containing mag data */
struct bmm150_mag_data data;
For device:
/*! @brief structure definition to hold the data and other info from the module */
typedef struct
{
float x;
float y;
float z;
}vector_3d_t;
vector_3d_t mag_in;
//Remap it according your HW board
mag_in.x = bmm150dev.data.x;
mag_in.y = -bmm150dev.data.y;
mag_in.z = -bmm150dev.data.z;