Calibrating the MPU 6050
MPU 6050 calibration can be done using the Energia code, which is used to display the raw values of the sensor mentioned in Chapter 6, Working with Robotic Sensors. This example is already available in Energia examples. You will get this code by navigating to File/Examples/MPU 6050/Examples/MPU 6050_raw
. Load this sketch into Energia and follow the procedure given here:
- Place the MPU 6050 breakout board on a flat surface. We can use an inclinometer to check the inclination of the surface.
- Modify the current program by setting the offset to zero. We can set the offset of three axes values of gyroscope to
0
using the following function:("setXGyroOffset , setYGyroOffset , setZGyroOffset" =0)
- Upload the raw code to Launchpad and take the Energia serial monitor to confirm whether the serial data is coming from the Launchpad. Leave the breakout for 5 to 10 minutes to allow the temperature to stabilize and read the gyro values and note down the values.
- Set the offset...