Pages: [1]   Go Down
Author Topic: Changing acceleration settings on gy-521 using the MPU-6050  (Read 1011 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.51 KB - downloaded 9 times.)
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
MPU6050_write_reg (MPU6050_ACCEL_CONFIG, MPU6050_AFS_SEL_16G);

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




Logged

Pages: [1]   Go Up
Jump to: