33#include "SensorQMI8658.hpp"
34#ifdef ARDUINO_T_BEAM_S3_SUPREME
35#include <XPowersAXP2101.tpp>
92#if defined(ARDUINO_T_BEAM_S3_SUPREME)
94 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
98 power.setALDO1Voltage(3300); power.enableALDO1();
99 power.setALDO2Voltage(3300); power.enableALDO2();
105 Serial.begin(115200);
114#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
122 Serial.println(
"Failed to find QMI8658 - check your wiring!");
129 Serial.print(
"Device ID:");
134 Serial.println(
"Accelerometer self-test successful");
136 Serial.println(
"Accelerometer self-test failed!");
140 Serial.println(
"Gyroscope self-test successful");
142 Serial.println(
"Gyroscope self-test failed!");
234 Serial.println(
"Read data now...");
251 Serial.print(
"ACCEL.x:"); Serial.print(
acc.
x); Serial.print(
",");
252 Serial.print(
"ACCEL.y:"); Serial.print(
acc.
y); Serial.print(
",");
253 Serial.print(
"ACCEL.z:"); Serial.print(
acc.
z); Serial.println();
268 Serial.print(
"GYRO.x:"); Serial.print(
gyr.
x); Serial.print(
",");
269 Serial.print(
"GYRO.y:"); Serial.print(
gyr.
y); Serial.print(
",");
270 Serial.print(
"GYRO.z:"); Serial.print(
gyr.
z); Serial.println();
bool begin(CommInterface interface, SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr=0)
Initialize the sensor using custom callback interface.
QMI8658 IMU sensor driver class.
bool getGyroscope(float &x, float &y, float &z)
Get the raw gyroscope data.
void dumpCtrlRegister()
Dump the control register values.
uint8_t getChipID() override
Get the chip ID / WHO_AM_I value.
void enableINT(IntPin pin, bool enable=true)
Enable or disable the interrupt.
bool selfTestGyro()
Perform gyroscope self-test.
bool configAccelerometer(AccelRange range, AccelODR odr, LpfMode lpfOdr=LPF_MODE_0)
Configure the accelerometer.
bool configGyroscope(GyroRange range, GyroODR odr, LpfMode lpfOdr=LPF_MODE_0)
Configure the gyroscope.
bool enableGyroscope()
Enable the gyroscope.
bool enableAccelerometer()
Enable the accelerometer.
bool getDataReady()
Check if new data is available.
bool selfTestAccel()
Perform accelerometer self-test.
bool getAccelerometer(float &x, float &y, float &z)
Get the accelerometer data.