Compass sensor library

Dependents:   compassDemo weather_station_proj weather_station_project weather_station_proj_v1_2

Files at this revision

API Documentation at this revision

Comitter:
acracan
Date:
Thu Jul 05 17:59:23 2018 +0000
Parent:
2:4debef04091d
Commit message:
Swap Z and Y in internal vector

Changed in this revision

HMC5983.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4debef04091d -r c2cd6cc71ee2 HMC5983.cpp
--- a/HMC5983.cpp	Thu Jul 05 17:57:00 2018 +0000
+++ b/HMC5983.cpp	Thu Jul 05 17:59:23 2018 +0000
@@ -225,8 +225,8 @@
 
     // compose byte for X, Y, Z's LSB & MSB 8bit registers
     H[0] = (uint16_t(X_MSB) << 8) | X_LSB;
-    H[1] = (uint16_t(Z_MSB) << 8) | Z_LSB;
-    H[2] = (uint16_t(Y_MSB) << 8) | Y_LSB;
+    H[1] = (uint16_t(Y_MSB) << 8) | Y_LSB;
+    H[2] = (uint16_t(Z_MSB) << 8) | Z_LSB;
 }
 
 void HMC5983::computeCalibratedHeadingVector(float *v)