diff --git a/examples/QMI8658_BlockExample/QMI8658_BlockExample.ino b/examples/QMI8658_BlockExample/QMI8658_BlockExample.ino index 3d61367..ca2aeb2 100644 --- a/examples/QMI8658_BlockExample/QMI8658_BlockExample.ino +++ b/examples/QMI8658_BlockExample/QMI8658_BlockExample.ino @@ -89,7 +89,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 -//Use tbeams3 defalut spi pin +//Use LilyGo-T-Beam-S3 default spi pin #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -102,7 +102,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22) @@ -148,9 +148,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( @@ -182,9 +180,7 @@ 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), diff --git a/examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino b/examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino index 66c5d82..8ad67da 100644 --- a/examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino +++ b/examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino @@ -32,8 +32,10 @@ #include #include "SensorQMI8658.hpp" -#define USE_WIRE +// #define USE_WIRE + +#if defined(USE_WIRE) #ifndef SENSOR_SDA #define SENSOR_SDA 17 #endif @@ -46,8 +48,31 @@ #define SENSOR_IRQ -1 #endif +#else + +//USE SPI +#ifndef SPI_MOSI +#define SPI_MOSI (35) +#endif + +#ifndef SPI_SCK +#define SPI_SCK (36) +#endif + +#ifndef SPI_MISO +#define SPI_MISO (37) +#endif + +#ifndef IMU_CS +#define IMU_CS (34) +#endif + +#ifndef IMU_INT +#define IMU_INT (33) +#endif + +#endif -#define IMU_CS 5 SensorQMI8658 qmi; @@ -72,7 +97,7 @@ void setup() } } #else - if (!qmi.begin(IMU_CS)) { + if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { Serial.println("Failed to find QMI8658 - check your wiring!"); while (1) { delay(1000); @@ -111,9 +136,9 @@ 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( @@ -145,9 +170,9 @@ 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), @@ -168,23 +193,23 @@ void loop() if (qmi.getDataReady()) { if (qmi.getAccelerometer(acc.x, acc.y, acc.z)) { - Serial.print("{ACCEL: "); + Serial.print("ACCEL.x:"); Serial.print(acc.x); - Serial.print(","); + Serial.print(",ACCEL.y:"); Serial.print(acc.y); - Serial.print(","); + Serial.print(",ACCEL.z:"); Serial.print(acc.z); - Serial.println("}"); + Serial.println(""); } if (qmi.getGyroscope(gyr.x, gyr.y, gyr.z)) { - Serial.print("{GYRO: "); + Serial.print("GYRO.x:"); Serial.print(gyr.x); - Serial.print(","); - Serial.print(gyr.y ); - Serial.print(","); + Serial.print(",GYRO.y:"); + Serial.print(gyr.y); + Serial.print(",GYRO.z:"); Serial.print(gyr.z); - Serial.println("}"); + Serial.println(""); } Serial.print("\t\t\t\t > "); Serial.print(qmi.getTimestamp()); diff --git a/examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino b/examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino index daf6ddb..16f2027 100644 --- a/examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino +++ b/examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino @@ -88,7 +88,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 -//Use tbeams3 defalut spi pin +//Use LilyGo-T-Beam-S3 default spi pin #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -101,7 +101,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22) diff --git a/examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino b/examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino index be4fa01..265d2ad 100644 --- a/examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino +++ b/examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino @@ -70,7 +70,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 -//Use tbeams3 defalut spi pin +//Use LilyGo-T-Beam-S3 default spi pin #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -83,7 +83,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22) diff --git a/examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino b/examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino index 2137200..1e0b054 100644 --- a/examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino +++ b/examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino @@ -105,7 +105,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 -//Use tbeams3 default spi pin +//Use LilyGo-T-Beam-S3 default spi pin #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -118,7 +118,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22) diff --git a/examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino b/examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino index e78650e..9f23b15 100644 --- a/examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino +++ b/examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino @@ -112,9 +112,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( @@ -146,9 +144,7 @@ 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), diff --git a/examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino b/examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino index 9d5de7c..51b0259 100644 --- a/examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino +++ b/examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino @@ -106,9 +106,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( @@ -140,9 +138,7 @@ 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), diff --git a/examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino b/examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino index e5a1d71..948739a 100644 --- a/examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino +++ b/examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino @@ -113,9 +113,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( @@ -147,9 +145,7 @@ 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); qmi.configFIFO( /** diff --git a/examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino b/examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino index 36b86da..752b143 100644 --- a/examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino +++ b/examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino @@ -79,7 +79,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 - //Use tbeams3 defalut spi pinz + //Use LilyGo-T-Beam-S3 default spi pinz #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -92,7 +92,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22) diff --git a/examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino b/examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino index 38f3dcc..efe75ba 100644 --- a/examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino +++ b/examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino @@ -84,7 +84,7 @@ void setup() #else #ifndef CONFIG_IDF_TARGET_ESP32 - //Use tbeams3 defalut spi pinz + //Use LilyGo-T-Beam-S3 default spi pinz #define SPI_MOSI (35) #define SPI_SCK (36) #define SPI_MISO (37) @@ -97,7 +97,7 @@ void setup() if (!qmi.begin(IMU_CS, SPI_MOSI, SPI_MISO, SPI_SCK)) { #else -//Use esp32dev module defalut spi pin +//Use esp32dev module default spi pin #define IMU_CS (5) #define IMU_INT1 (15) #define IMU_INT2 (22)