1 Reply Latest reply on Jun 18, 2015 6:39 AM by MichaelF_56

    Bug in accelerometer driver for WICED Sense (lis3dsh_driver.h)

      I've found that the defined values for Control register 5 doesn't match with the datasheet. This bug directly affects Full-Scale setting (sensitivity) of the sensor.

      Capture.PNG

      In "lis3dsh_driver.h" from line 250 to 255 should be fixed this way.

      //CONTROL REGISTER 5
      #define CNTL5 0x24
      #define BW BIT(6)      //from BIT(7)
      #define FSCALE BIT(3)  //from BIT(5)
      #define ST BIT(1)      //from BIT(2)
      #define SIM BIT(0)
      
      

       

      Moreover, be careful when you have to call GetAccAxesRaw(AxesRaw_t* buff) because it will divide the raw value by 16.

       

      They cost me a few hours finding what's wrong with my code.