tockn / MPU6050_tockn

Arduino library for easy communication with MPU6050
218 stars 84 forks source link

Accelerometer and gyroscope sensitivity #47

Open ambiayhm opened 2 years ago

ambiayhm commented 2 years ago

Hello, I would like to know the default sensitivity for both the accelerometer and gyroscope in this library and if possible would want to change it. Thank you so much

(full scale ranges) acceleration: ±2g ±4g ±8g ±16g rotation: ±250°/s ±500°/s ±1000°/s ±2000°/s.

I'm thinking it might be ±2g and ±500°/s but I might be wrong.

ASionville commented 1 year ago

I am interested in having the ability to modify these too. Actually I am looking for ±16g of range

I think it might have something to do with thoses lines at the beginning of _MPU6050tockn.cpp :

  writeMPU6050(MPU6050_SMPLRT_DIV, 0x00);
  writeMPU6050(MPU6050_CONFIG, 0x00);
  writeMPU6050(MPU6050_GYRO_CONFIG, 0x08);
  writeMPU6050(MPU6050_ACCEL_CONFIG, 0x00);
  writeMPU6050(MPU6050_PWR_MGMT_1, 0x01);

I tried changing the 0x00 of _MPU6050_ACCELCONFIG to 0x03 as in the documentation ±16g is for _AFSSEL=3 (Page 13 of this document) But it did nothing, the values are saturated when getting out of [-2,2]

If you have more information about it please let me know