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() {
Serial.begin(9600);
while (!Serial);

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

while (1) yield();

}

Serial.print(“Gyroscope sample rate = “);
Serial.print(IMU.gyroscopeSampleRate());
Serial.println(” Hz”);
Serial.println();
Serial.println(“Gyroscope in degrees/second”);
Serial.println(“X\tY\tZ”);
}

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

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

Serial.print(x);
Serial.print('\t');
Serial.print(y);
Serial.print('\t');
Serial.println(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

the
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.

nRF52_XIAO_IMU_Madgwick_peripheral.zip (17.4 KB)

THANK YOU

this method worked great