m5stack / M5StickC-Plus

M5StickCPlus Arduino Library
MIT License
359 stars 90 forks source link

Wrong IMU pins #55

Closed sylque closed 2 months ago

sylque commented 8 months ago

Describe the bug

The sketch M5StickC-Plus/examples/Basics/IMU/IMU.ino doesn't work because the line imu6886.Init(32, 33) is wrong. With my device, it should be imu6886.Init(GPIO_NUM_21, GPIO_NUM_22).

To reproduce

  1. Compile and run M5StickC-Plus/examples/Basics/IMU/IMU.ino => IMU readings are random

Expected behavior

IMU readings are correct

Screenshots

No response

Environment

Additional context

No response

Issue checklist

sylque commented 8 months ago

Oops, it seems I'm using the wrong version of IMU.ino... Please let me investigate and clarify this.

sylque commented 8 months ago

Ok, this is puzzling. There are two sketches for testing the IMU in this repo:

  1. https://github.com/m5stack/M5StickC-Plus/tree/master/examples/Basics/IMU
  2. https://github.com/m5stack/M5StickC-Plus/tree/master/examples/Unit/IMU_MPU6886

Only the second one has the issue described in this thread, the first one seems ok.

Tinyu-Zhao commented 2 months ago

You are right, Unit IMU_MPU6886 is an external device, using external I2C.