Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: LSM9DS1.h
- Revision:
- 4:681443188833
- Parent:
- 2:e8c2301f7523
--- a/LSM9DS1.h Sun Mar 13 21:40:10 2016 +0000 +++ b/LSM9DS1.h Mon Jan 27 10:47:24 2020 +0000 @@ -34,8 +34,11 @@ #include "LSM9DS1_Registers.h" #include "LSM9DS1_Types.h" -#define LSM9DS1_AG_ADDR(sa0) ((sa0) == 0 ? 0x6A : 0x6B) -#define LSM9DS1_M_ADDR(sa1) ((sa1) == 0 ? 0x1C : 0x1E) +#define LSM9DS1_AG_ADDR 0xD4 // Device address when ADO = 1 +#define LSM9DS1_M_ADDR 0x38 // Address of magnetometer + +//#define LSM9DS1_AG_ADDR(sa0) ((sa0) == 0 ? 0x6A : 0x6B) +//#define LSM9DS1_M_ADDR(sa1) ((sa1) == 0 ? 0x1C : 0x1E) enum lsm9ds1_axis { X_AXIS, @@ -83,7 +86,8 @@ * in the IMUSettings struct will take effect after calling this function. */ uint16_t begin(); - + void selftestLSM9DS1(); + void accelgyrocalLSM9DS1(float * dest1, float * dest2); void calibrate(bool autoCalc = true); void calibrateMag(bool loadIn = true); void magOffset(uint8_t axis, int16_t offset); @@ -550,6 +554,7 @@ // all stored in the *dest array given. uint8_t I2CreadBytes(uint8_t address, uint8_t subAddress, uint8_t * dest, uint8_t count); + private: I2C i2c; };