Changing acceleration settings on gy-521 using the MPU-6050

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.

Final_Design_3axis.ino (31.5 KB)

So you found the Playground page about the MPU-6050 : Arduino Playground - MPU-6050

Read the datasheet, and place it in the code.
For example at the end of the 'setup' function, try adding this line:

MPU6050_write_reg (MPU6050_ACCEL_CONFIG, MPU6050_AFS_SEL_16G);

You can combine the register bits like this: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.