Search code examples
arduinoaccelerometerarduino-unoarduino-ide

Activting low pass filter on MPU6050


I would like to activate the low pass filter of 94 Hz bandwidth on my MPU 6050. By reading the documentation (PAGE 13), it says that you activate the appropriate bandwidth by writing the selected number into address 1A (PAGE 6).

Would this inside the void setup be okay to do so?

Wire.beginTransmission(0x68);
Wire.write(0x1A);  // 
Wire.write(2);     // 
Wire.endTransmission(true);

Kind regards,

L


Solution

  • Assuming you want to just set the bandwidth setting and not the FSYNC bits, then yes you should write:

    Wire.beginTransmission(0x68);
    Wire.write(0x1A);  // the config address
    Wire.write(0x02);  // the config value
    Wire.endTransmission(true);
    

    Other configuration registers can be set similarly, but you must be aware of bit-packed fields and concatenate them properly.