Updated example, compatible with QMC6310N

This commit is contained in:
lewisxhe 2026-01-14 16:10:35 +08:00
commit 0779b8289a
19 changed files with 114 additions and 123 deletions

View file

@ -52,7 +52,7 @@ void setup()
// SDCard shares SPI bus with QMI8658
// SPI has been initialized in initBoard.
// Only need to pass SPIhandler to the QMI class.
if (!qmi.begin(IMU_CS, -1, -1, -1, SDCardSPI)) {
if (!qmi.begin(SDCardSPI, IMU_CS)) {
Serial.println("Failed to find QMI8658 - check your wiring!");
while (1) {
delay(1000);
@ -90,9 +90,7 @@ void setup()
* LPF_MODE_2 //5.39% of ODR
* LPF_MODE_3 //13.37% of ODR
* */
SensorQMI8658::LPF_MODE_0,
// selfTest enable
true);
SensorQMI8658::LPF_MODE_0);
qmi.configGyroscope(
@ -124,9 +122,8 @@ void setup()
* LPF_MODE_2 //5.39% of ODR
* LPF_MODE_3 //13.37% of ODR
* */
SensorQMI8658::LPF_MODE_3,
// selfTest enable
true);
SensorQMI8658::LPF_MODE_3
);
// In 6DOF mode (accelerometer and gyroscope are both enabled),
@ -140,9 +137,9 @@ void setup()
pinMode(IMU_INT2, INPUT);
#endif
// qmi.enableINT(SensorQMI8658::IntPin1); //no use
// qmi.enableINT(SensorQMI8658::INTERRUPT_PIN_1); //no use
// Enable data ready to interrupt pin2
qmi.enableINT(SensorQMI8658::IntPin2);
qmi.enableINT(SensorQMI8658::INTERRUPT_PIN_2);
qmi.enableDataReadyINT();
// Print register configuration information