first release fork of MPU9250AHRS from Kris Winer
Dependents: mbed-os-i2c-test mbed-test-i2c-PCA-biquad-peakdet Mix-code-v2 mbed-os-step-counting ... more
Diff: MPU9250.h
- Revision:
- 1:c27bb1a0deca
- Parent:
- 0:76dc2aad77bc
--- a/MPU9250.h Wed Oct 05 10:33:45 2016 +0000 +++ b/MPU9250.h Wed Oct 05 10:40:48 2016 +0000 @@ -9,7 +9,7 @@ { I2C i2c; public: - mpu9250(PinName _sda, PinName _scl); + mpu9250(PinName _sda, PinName _scl, uint8_t address); void writeByte(uint8_t address, uint8_t subAddress, uint8_t data); char readByte(uint8_t address, uint8_t subAddress); void readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest); @@ -28,6 +28,7 @@ float aRes, gRes; // scale resolutions per LSB for the sensors float gyroBias[3]; float accelBias[3]; // Bias corrections for gyro and accelerometer + uint8_t MPU9250_ADDRESS; private: @@ -164,11 +165,5 @@ #define AFS_8G 0x10 #define AFS_16G 0x18 -#define ADO 0 -#if ADO -#define MPU9250_ADDRESS 0x69<<1 // Device address when ADO = 1 -#else -#define MPU9250_ADDRESS 0x68<<1 // Device address when ADO = 0 -#endif