How to access wire1 with bluefruit library

I want to use the bluefruit dual role bleuart

but I ALSO need the IMU

Does anyone know how to do this… i have been banging my head against the wall trying to find a way to accomplish this.

How did it get working in mbed core? i want to replicate whatever made it work on the blue fruit library

Assuming you are using this: Dual Roles BLEUART | Bluefruit nRF52 Feather Learning Guide | Adafruit Learning System

Check in the two board variant files and make sure that the XIAO IMU I2C control pin(s) are not being used by the Adafruit dual UART program.

Even the seed lsm6ds3 library examples dont work on the non embed version

Wire1 just plain doesnt work

Can someone please tell me what they did to get it working in later versions?

This one works on version 1.0

Arduino LSM6DS3 - Simple Gyroscope

This example reads the gyroscope values from the LSM6DS3
sensor and continuously prints them to the Serial Monitor
or Serial Plotter.

The circuit:

  • Arduino Uno WiFi Rev 2 or Arduino Nano 33 IoT

created 10 Jul 2019
by Riccardo Rizzo

This example code is in the public domain.

#include <Arduino_LSM6DS3TR_C.h>

void setup() {
while (!Serial);

if (!IMU.begin()) {
Serial.println(“Failed to initialize IMU!”);

while (1) yield();


Serial.print(“Gyroscope sample rate = “);
Serial.println(” Hz”);
Serial.println(“Gyroscope in degrees/second”);

void loop() {
float x, y, z;

if (IMU.gyroscopeAvailable()) {
IMU.readGyroscope(x, y, z);



Hi Matthew_DeBlock

It may not be the right way, but I am using the IMU implemented in “Seeed XIAO nRF52840 Sense” on “Seeed nRF52 Borads 1.0.0” (non mbed) in the following way

Board library: Seeed nRF52 Borads 1.0.0 (non mbed)
Board : Seeed nRF52 Borads / Seeed XIAO nRF52840 Sense
IMU library: Seeed_Arduino_LSM6DS3
–>Replace “Wire” in LSM6DS3.cpp with “Wire1”.

1 Like

Seeed Arduino Lsm6ds3 library already does that, doesn’t it?
it has …
#define Wire Wire1
(on line 36 of LSM6DS3.cpp)

When I use this library i get garbage data, a bunch of repeating values that never change and a bunch of errors reports.

#define Wire Wire1” does not work as expected, so I rewrote Wire to Wire1.
My sketch is attached for reference. The comments are in Japanese so I don’t think you can read them, but please bear with me. (17.4 KB)


this method worked great

@msfujino and @Matthew_DeBlock
The reason “#define Wire Wire1” doesn’t work with embed is the target processor type has a slightly different name.

For non-embed code it is
And on the embed version it uses:

You can see what the two versions are by turning on compilation verbosity.
Check box for “Show verbose output during compile”.

So instead of editing the entire file and changing all Wire to Wire1 you can edit and change from:

#define Wire Wire1


#define Wire Wire1
#elif defined(ARDUINO_Seeed_XIAO_nRF52840_Sense)
#define Wire Wire1

Hi Don.Small,
Thanks for the information. I have confirmed that it works.
Why don’t you post it to “Lib for Seeed Xiao Sens, IC2 wire1 define not OK · Issue #10 · Seeed-Studio/Seeed_Arduino_LSM6DS3 · GitHub” for an official fix for the library?

1 Like