Sigh…
I think that the XIAO BLE boards are terrific pieces of hardware, but the Seeed development software releases are VERRRRRY frustrating.
So, here’s a way to use the IMU on the XIAO BLE Sense. (You can try other board release package versions and different libraries, but this works for me. I won’t bore you with details of all of the stuff I tried that did not work. I tested the following today, August 15, 2022, but those Seeed guys might change something that screws the pooch. Wouldn’t be the first time. Sigh…)
First of all, if you have any libraries that have a file named LSM6DS3.h, move their directory away from your Sketchbook\Libraries directory. (I’m speaking specifically of the Arduino_LSM6DS3 library. Warning: Don’t just rename the library directory, move it to some place completely away from your Sketchbook and Sketchbook\Libraries).
Next, use the Arduino Libraries Manager to install the Seed Arduino LSM6DS3 library version 2.0.3
Now, if you have not installed the Seeed nrf52 mbed-enabled Boards package, version 2.7.2, use the Arduino Boards manager to install it.
For a new board installation, you may have to exit the Arduino IDE and re-invoke it to see the next results:
Select the Seeed XIAO BLE Sense - nrf52840 board from the board package you just installed.
Finally (well, almost finally):
There is a sketch named HighLevelExample in the Seeed Arduino LSM6DS3 library. It works for me with no modifications and no problems.
Not wanting to go through this every time I want to use (or tell someone how to use) the LSM6DS3 on the XIAO BLE Sense, I modified that file to print the board version and library version that I used to create the output, and I attached the zipped project below.
Finally (Yes, I promise: Finally!):
Here’s the output up to the end of the first time through loop():
XIAO BLE Sense test of LSM6DS3 compiled on Aug 15 2022 at 14:00:06
Seeed mbed-enabled nrf52 Boards-> Seeed XIAO BLE Sense - nrf52480
From board release verion 2.7.6
Using Seeed Arduino LSM6DS3 Library version 2.0.3
Device OK!
Accelerometer:
X1 = -0.0039
Y1 = -0.0590
Z1 = 1.0287
Gyroscope:
X1 = 0.4900
Y1 = -2.3800
Z1 = 0.2800
Thermometer:
Degrees C1 = 29.9375
Degrees F1 = 85.8875
Regards,
Dave
Seeed mbed-enabled nrf52 package.
Daves_HighLevelExample.zip (1.5 KB)