Skip to content

Commit 3b5e731

Browse files
authored
Merge pull request #706 from mjcross/patch-2
Fix incorrect pin numbers
2 parents 2c738ae + eae2846 commit 3b5e731

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

RP2040/MPU6050/examples/mpu6050_DMP_V6.12/mpu6050_DMP_port.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void dmpDataReady() {
3535

3636
int main() {
3737
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)
3939
i2c_init(i2c_default, 400 * 1000);
4040
gpio_set_function(PICO_DEFAULT_I2C_SDA_PIN, GPIO_FUNC_I2C);
4141
gpio_set_function(PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C);
@@ -59,6 +59,19 @@ int main() {
5959

6060
mpu.initialize();
6161
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+
6275
if (devStatus == 0)
6376
{
6477
mpu.setDMPEnabled(true); // turn on the DMP, now that it's ready

0 commit comments

Comments
 (0)