Mpu9250
Diff: MPU9250.cpp
- Revision:
- 1:ca2a40219dc1
- Parent:
- 0:98a0cccbc509
--- a/MPU9250.cpp Tue Jul 05 07:09:43 2016 +0000 +++ b/MPU9250.cpp Mon Feb 24 06:46:33 2020 +0000 @@ -223,6 +223,10 @@ // can join the I2C bus and all can be controlled by the Arduino as master writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x22); writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit 0) interrupt + writeByte(MPU9250_ADDRESS, PWR_MGMT_1, 0x00); +writeByte(MPU9250_ADDRESS, CONFIG, 0x00); +writeByte(MPU9250_ADDRESS, 0x1B, 0x18); +writeByte(MPU9250_ADDRESS, 0x1C, 0x18); } // Function which accumulates gyro and accelerometer data after device initialization. It calculates the average @@ -256,7 +260,7 @@ writeByte(MPU9250_ADDRESS, CONFIG, 0x01); // Set low-pass filter to 188 Hz writeByte(MPU9250_ADDRESS, SMPLRT_DIV, 0x00); // Set sample rate to 1 kHz writeByte(MPU9250_ADDRESS, GYRO_CONFIG, 0x00); // Set gyro full-scale to 250 degrees per second, maximum sensitivity - writeByte(MPU9250_ADDRESS, ACCEL_CONFIG, 0x00); // Set accelerometer full-scale to 2 g, maximum sensitivity + writeByte(MPU9250_ADDRESS, ACCEL_CONFIG, 0x04); // Set accelerometer full-scale to 2 g, maximum sensitivity uint16_t gyrosensitivity = 131; // = 131 LSB/degrees/sec uint16_t accelsensitivity = 16384; // = 16384 LSB/g