File tree 1 file changed +14
-1
lines changed
RP2040/MPU6050/examples/mpu6050_DMP_V6.12 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ void dmpDataReady() {
35
35
36
36
int main () {
37
37
stdio_init_all ();
38
- // This example will use I2C0 on the default SDA and SCL pins (4, 5 on a Pico)
38
+ // This example will use I2C0 on the default SDA and SCL ( pins 6, 7 on a Pico)
39
39
i2c_init (i2c_default, 400 * 1000 );
40
40
gpio_set_function (PICO_DEFAULT_I2C_SDA_PIN, GPIO_FUNC_I2C);
41
41
gpio_set_function (PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C);
@@ -59,6 +59,19 @@ int main() {
59
59
60
60
mpu.initialize ();
61
61
devStatus = mpu.dmpInitialize ();
62
+
63
+ /* --- if you have calibration data then set the sensor offsets here --- */
64
+ // mpu.setXAccelOffset();
65
+ // mpu.setYAccelOffset();
66
+ // mpu.setZAccelOffset();
67
+ // mpu.setXGyroOffset();
68
+ // mpu.setYGyroOffset();
69
+ // mpu.setZGyroOffset();
70
+
71
+ /* --- alternatively you can try this (6 loops should be enough) --- */
72
+ // mpu.CalibrateAccel(6);
73
+ // mpu.CalibrateGyro(6);
74
+
62
75
if (devStatus == 0 )
63
76
{
64
77
mpu.setDMPEnabled (true ); // turn on the DMP, now that it's ready
You can’t perform that action at this time.
0 commit comments