Interface library for STMicro LSM303DLH 3-axis magnetometer w/ 3-axis acceleromter. Computes magnetic heading.

Dependents:   FCFS

Fork of LSM303DLH by Michael Shimniok

Revision:
1:48d83c63d1d9
Parent:
0:de767f4959ef
Child:
2:aea5caec809c
--- a/LSM303DLH.h	Wed Apr 06 05:05:10 2011 +0000
+++ b/LSM303DLH.h	Fri Apr 08 07:29:51 2011 +0000
@@ -1,4 +1,11 @@
-/** LSM303DLH Interface Library
+#include "mbed.h"
+#include "vector.h"
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+/** Tilt-compensated compass interface Library for the STMicro LSM303DLH 3-axis magnetometer, 3-axis acceleromter
  *
  * Michael Shimniok http://bot-thoughts.com
  *
@@ -52,14 +59,8 @@
  *     wait(0.1);
  *   }
  * }
+ * @endcode
  */
-#include "mbed.h"
-#include "vector.h"
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 class LSM303DLH {
     public:
     
@@ -122,7 +123,10 @@
         float _scale_x;
         float _scale_y;
         float _scale_z;
-        
+        long _filt_ax;
+        long _filt_ay;
+        long _filt_az;
+       
         bool write_reg(int addr_i2c,int addr_reg, char v);
         bool read_reg(int addr_i2c,int addr_reg, char *v);
         bool read_reg_short(int addr_i2c,int addr_reg, short *v);