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>
100const uint8_t rectWidth = 10;
105#if defined(ARDUINO_T_BEAM_S3_SUPREME)
106 XPowersAXP2101 power;
107 power.begin(Wire1, AXP2101_SLAVE_ADDRESS, 42, 41);
108 power.disableALDO1();
109 power.disableALDO2();
111 power.setALDO1Voltage(3300);
113 power.setALDO2Voltage(3300);
120 Serial.begin(115200);
131#if defined(SPI_MOSI) && defined(SPI_SCK) && defined(SPI_MISO)
139 Serial.println(
"Failed to find QMI8658 - check your wiring!");
146 Serial.print(
"Device ID:");
149 display.flipScreenVertically();
232 Serial.println(
"Read data now...");
238 float roll = 0, pitch = 0, heading = 0;
254 pitch =
filter.getPitch();
255 heading =
filter.getYaw();
260 posX = constrain(posX, 0, display.width() - rectWidth);
261 posY = constrain(posY, 0, display.height() - rectWidth);
263 display.setColor(BLACK);
264 display.fillRect(lastPosX, lastPosY, 10, 10);
265 display.setColor(WHITE);
266 display.fillRect(posX, posY, 10, 10);
279 Serial.begin(115200);
284 Serial.println(
"The graphics library may not be supported on the esp32 platform");
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.
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 getAccelerometer(float &x, float &y, float &z)
Get the accelerometer data.
uint32_t microsPerReading