XIAO: I2C connection to Adafruit SHT40 doesn't work when using mbed-enabled


I need to transmit highly accurate and time-sensitive temperature and humidity data via BLE and am using ArduinoBLE.h for this.
The sensor I use is the Sensirion SHT-40 on an Adafruit breakout board: Adafruit Sensirion SHT40 Temperature & Humidity Sensor [STEMMA QT / Qwiic] : ID 4885 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Now when I compile and upload the sample code (Examples → Adafruit SHT4x Library → SHT4-test) using the non-mbed-board uploader in Arduino IDE, everything works right as expected.
But then I can’t use ArduinoBLE, giving me the compile error:

WARNING: library ArduinoBLE claims to run on samd, megaavr, mbed, apollo3, mbed_nano, mbed_portenta, mbed_nicla, esp32 architecture(s) and may be incompatible with your current board which runs on nrf52 architecture(s)

When I use the mbed-board uploader setting, the SHT4x-example tells me that my sensor is not connected.

So I either cannot use ArduinoBLE or the sensor :smiley:

What am I doing wrong?


nevermind I solved it myself, using the original Sensirion sht4-library instead of Adafruits “fork” of it. Working perfectly with Adafruits breakout board and mbed-board.