Go Down

Topic: Changing acceleration settings on gy-521 using the MPU-6050 (Read 1 time) previous topic - next topic


I am trying to measure the acceleration of an object but by default the MPU6050 is set to measure +- 2g.  It is capable of measuring up to +-16g but I have not been able to edit the sketch I found to set it to measure up to 16g.  I commented out parts of the original code I did not think I needed. 


So you found the Playground page about the MPU-6050 : http://arduino.cc/playground/Main/MPU-6050

Read the datasheet, and place it in the code.
For example at the end of the 'setup' function, try adding this line:
Code: [Select]
MPU6050_write_reg (MPU6050_ACCEL_CONFIG, MPU6050_AFS_SEL_16G);

You can combine the register bits like this:
Code: [Select]
MPU6050_write_reg (MPU6050_ACCEL_CONFIG, MPU6050_AFS_SEL_16G | MPU6050_ACCEL_HPF_2_5HZ);

I have not tried it myself, so I'm not sure it will work.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131