Skip to content

Conversation

@microbuilder
Copy link
Member

The magnetometer on the LSM303DLHC has a different gain conversion
factor for LSB to Gauss for the Z axis than it does for X, Y. This
commit takes into account the different conversion factors, and
adds the correct coefficients for each gain setting and axis.

Signed-off-by: Kevin Townsend [email protected]

@microbuilder microbuilder added bug The issue is a bug, or the PR is fixing a bug area: Drivers area: Sensors Sensors labels Sep 28, 2021
@microbuilder microbuilder self-assigned this Sep 28, 2021
@microbuilder microbuilder added this to the v3.0.0 milestone Sep 28, 2021
@microbuilder
Copy link
Member Author

See table 3 in the datasheet for details:

Screenshot 2021-09-28 at 13 14 01

Copy link
Contributor

@avisconti avisconti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean indeed... Thanks!

The magnetometer on the LSM303DLHC has a different gain conversion
factor for LSB to Gauss for the Z axis than it does for X, Y. This
commit takes into account the different conversion factors, and
adds the correct coefficients for each gain setting and axis.

Signed-off-by: Kevin Townsend <[email protected]>
@cfriedt cfriedt merged commit 21321fb into zephyrproject-rtos:main Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Drivers area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants