Skip to content

Commit

Permalink
Reduce qmc sampling rate to 100hz
Browse files Browse the repository at this point in the history
  • Loading branch information
deiteris committed Oct 8, 2022
1 parent 3cf5435 commit c2f98ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/mpu9250/MPU9250.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3338,8 +3338,8 @@ void MPU9250_Base::initilaizeMagnetometer() {
I2Cdev::writeByte(devAddr, MPU9250_RA_I2C_SLV0_ADDR, 0x0D);
// I2C slave 0 register address from where to begin data transfer
I2Cdev::writeByte(devAddr, MPU9250_RA_I2C_SLV0_REG, 0x09);
// Start measurements in continuous mode 200hz at 8G scale
I2Cdev::writeByte(devAddr, MPU9250_RA_I2C_SLV0_DO, 0x1D);
// Start measurements in continuous mode 100hz at 8G scale
I2Cdev::writeByte(devAddr, MPU9250_RA_I2C_SLV0_DO, 0x19);
// Enable I2C and write 1 byte
I2Cdev::writeByte(devAddr, MPU9250_RA_I2C_SLV0_CTRL, 0x81);
delay(50);
Expand Down
2 changes: 1 addition & 1 deletion src/sensors/mpu9250sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MPU9250Sensor : public Sensor
unsigned long now = 0, last = 0; // micros() timers
float deltat = 0; // loop time in seconds

float mag_frequency = 200.f;
float mag_frequency = 100.f;
float beta = 0.02f;
float mincutoff = 0.005f;
float d_cutoff = 1.0f;
Expand Down

0 comments on commit c2f98ca

Please sign in to comment.