Skip to content
Snippets Groups Projects
Commit 47d74654 authored by Karl Schwabe's avatar Karl Schwabe Committed by Lorenz Meier
Browse files

Bugfix: corrects orientation of magnetometer raw values

The magnetomer raw values were not being rotated in the same direction as
the scaled values. This meant that if the rotation was set to ROTATION_NONE,
the raw values and scaled values were off by 180 degrees.
parent 07a995a6
No related branches found
No related tags found
No related merge requests found
......@@ -987,8 +987,8 @@ HMC5883::collect()
* to align the sensor axes with the board, x and y need to be flipped
* and y needs to be negated
*/
new_report.x_raw = report.y;
new_report.y_raw = -report.x;
new_report.x_raw = -report.y;
new_report.y_raw = report.x;
/* z remains z */
new_report.z_raw = report.z;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment