33#include "SensorQMI8658.hpp"
34#ifdef ARDUINO_T_BEAM_S3_SUPREME
35#include <XPowersAXP2101.tpp>
89#if defined(ARDUINO_T_BEAM_S3_SUPREME)
91 power.
begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
95 power.setALDO1Voltage(3300); power.enableALDO1();
96 power.setALDO2Voltage(3300); power.enableALDO2();
109 Serial.begin(115200);
118#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
126 Serial.println(
"Failed to find QMI8658 - check your wiring!");
133 Serial.print(
"Device ID:");
152 float AnyMotionXThr = 100.0;
154 float AnyMotionYThr = 100.0;
156 float AnyMotionZThr = 1.0;
159 uint8_t AnyMotionWindow = 1;
164 float NoMotionXThr = 0.1;
166 float NoMotionYThr = 0.1;
168 float NoMotionZThr = 0.1;
172 uint8_t NoMotionWindow = 1;
175 uint16_t SigMotionWaitWindow = 1;
178 uint16_t SigMotionConfirmWindow = 1;
181 AnyMotionXThr, AnyMotionYThr, AnyMotionZThr, AnyMotionWindow,
182 NoMotionXThr, NoMotionYThr, NoMotionZThr, NoMotionWindow,
183 SigMotionWaitWindow, SigMotionConfirmWindow);
201 Serial.print(
"STATUS:"); Serial.print(status);
202 Serial.print(
" BIN:"); Serial.println(status, BIN);
205 Serial.println(
"Significant motion");
208 Serial.println(
"No Motion");
211 Serial.println(
"Any Motion");
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.
@ EVENT_SIGNIFICANT_MOTION
bool configMotion(uint8_t modeCtrl, float AnyMotionXThr, float AnyMotionYThr, float AnyMotionZThr, uint8_t AnyMotionWindow, float NoMotionXThr, float NoMotionYThr, float NoMotionZThr, uint8_t NoMotionWindow, uint16_t SigMotionWaitWindow, uint16_t SigMotionConfirmWindow)
uint8_t getChipID() override
Get the chip ID / WHO_AM_I value.
bool configAccelerometer(AccelRange range, AccelODR odr, LpfMode lpfOdr=LPF_MODE_0)
Configure the accelerometer.
bool enableMotionDetect(IntPin pin=IntPin::PIN1)
Enable motion detection on specified pin.
int getStatusRegister()
Get the Pedometer counter.
bool enableAccelerometer()
Enable the accelerometer.