33#ifdef ARDUINO_ARCH_ESP32
34#include "SensorQMI8658.hpp"
35#include <MadgwickAHRS.h>
36#include "SH1106Wire.h"
37#ifdef ARDUINO_T_BEAM_S3_SUPREME
38#include <XPowersAXP2101.tpp>
103#if defined(ARDUINO_T_BEAM_S3_SUPREME)
104 XPowersAXP2101 power;
105 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
106 power.disableALDO1();
107 power.disableALDO2();
109 power.setALDO1Voltage(3300); power.enableALDO1();
110 power.setALDO2Voltage(3300); power.enableALDO2();
116 Serial.begin(115200);
123 display.flipScreenVertically();
129#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
137 Serial.println(
"Failed to find QMI8658 - check your wiring!");
144 Serial.print(
"Device ID:");
238 Serial.println(
"Read data now...");
241const uint8_t rectWidth = 10;
245 float roll, pitch, heading;
251 if (digitalRead(
IMU_IRQ) == HIGH) {
261 pitch =
filter.getPitch();
262 heading =
filter.getYaw();
267 posX = constrain(posX, 0, display.width() - rectWidth);
268 posY = constrain(posY, 0, display.height() - rectWidth);
270 display.setColor(BLACK);
271 display.fillRect(lastPosX, lastPosY, 10, 10);
272 display.setColor(WHITE);
273 display.fillRect(posX, posY, 10, 10);
286 Serial.begin(115200);
291 Serial.println(
"The graphics library may not support your esp32 platform"); delay(1000);
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.
void enableDataReadyINT(bool enable=true)
Enable or disable the Data Ready interrupt.
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 getAccelerometer(float &x, float &y, float &z)
Get the accelerometer data.
uint32_t microsPerReading