Library for read the sensor LSM303D by I2C and configure the sensor for measure with frecuency 100Hz and range +-2g

Dependents:   1-K64F_with_5_acel

Fork of LSM303D by brian claus

Revision:
2:fcd607760ee8
Parent:
1:27d47f5de82c
--- a/LSM303D.h	Thu Dec 01 08:14:40 2016 +0000
+++ b/LSM303D.h	Thu Jan 18 07:52:30 2018 +0000
@@ -4,6 +4,7 @@
 #include "mbed.h"
 
 
+#define addr_acc_mag  0x3C
 
 class LSM303D {
     public:
@@ -12,7 +13,7 @@
          * @param sda is the pin for the I2C SDA line
          * @param scl is the pin for the I2C SCL line
          */
-        LSM303D(PinName sda, PinName scl);
+        LSM303D(I2C * puntero);
 
   
         /** read the raw accelerometer and compass values
@@ -20,18 +21,18 @@
          * @param ax,ay,az is the accelerometer 3d vector, written by the function
          * @param mx,my,mz is the magnetometer 3d vector, written by the function
          */
-         bool read(float *ax, float *ay, float *az, float *mx, float *my, float *mz);
+         bool read(double *ax, double *ay, double *az, double *mx, double *my, double *mz);
          bool readA(double *ax, double *ay, double *az);
-
+         bool read_reg(int addr_i2c,int addr_reg, char *v);
+         
     private:
-        I2C _LSM303;
+        I2C *_LSM303;
 
          
         float ax, ay, az;
         float mx, my, mz;         
          
         bool write_reg(int addr_i2c,int addr_reg, char v);
-        bool read_reg(int addr_i2c,int addr_reg, char *v);
         bool recv(char sad, char sub, char *buf, int length);
 };