sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
168 stars 72 forks source link

Compass and rotation #142

Closed minhanh1234 closed 8 months ago

minhanh1234 commented 8 months ago

Hi

Would you know if this chip can calculate compass angle like most magnetometer and would you have any example code to calculate rotation count? Example if i rotate the gyro on a table? (Example: 2 counter clockwise ration)

Thanks

PaulZC commented 8 months ago

Hi Minh (@minhanh1234 ),

You can calculate approximate angle from either the raw magnetometer readings or the DMP quaternions. Please see the examples for more details.

The DMP has no built-in support for rotation counting. You will need to add your own.

Best wishes, Paul