@felmue Finally I got the solution using separate Wires and PlattformIO to manage my libraries :)
With the following ini file (PlattformIO config file)
[env:miniscale]
platform = espressif32@6.1.0
board = m5stick-c
framework = arduino
lib_ldf_mode = deep
monitor_speed = 115200
build_flags =
-DCORE_DEBUG_LEVEL=0
-Wl,--allow-multiple-definition
lib_deps =
https://github.com/m5stack/M5StickCPlus2.git
m5stack/M5Unit-ENV@^1.0.1
Not knowing why, but I need the "-Wl" to run at all and the "--allow-multiple-definition" flag for the hat to work in conjunction with sensors mounted to the groove port.
It worked, however, I need to change the I2C begin call from "Wire0" (just called Wire) to the secondary I2C channel Wire1
Before:
while (!qmp.begin(&Wire, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
Serial.println("QMP6988 not found");
}
After:
while (!qmp.begin(&Wire1, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
Serial.println("QMP6988 not found");
}
Maybe this helps someone in the future :)