Using FIFO Buffer of IMU (LSM6DS3)

Hi everybody,

I'd like to write a code using the FIFO Buffer of the in-built IMU LSM6DS3.
I found one library, which includes FIFO functionality HERE. But unfortunately, there is no example, which uses the FIFO buffer and I have not yet figured out, how to make it working.

In the end, I want to send the acceleration data at about 100Hz via Wifi and POST-request to a server.

Anyone, who has already worked with it and can help me?

I appreciate any help...

UPTADE: I don't think the library is compatible with the Nano 33 IoT, because it is designed for STM32 boards... :-\

I also found a library from SparkFun, which has an example with Fifo usage. Unfortunately, it does not work with the Nano 33 IoT. I think this is because of the SPI communication of the example, whereas the board is using I2C communication plus it is designed for an external use of the LSM6DS3 IMU module.

Actually, I have no idea now how to find a solution, because I don't have the skills to write the whole thing myself... :slightly_frowning_face:

Please help!

Run the IDE Library manager and search for "nano 33 iot". One library is for the LSM6DS3.

gbafamily:
Run the IDE Library manager and search for "nano 33 iot". One library is for the LSM6DS3.

This library does unfortunately not support the FIFO buffer!

Hi emat and all,
I had the same problem and spent two days going around in circles. The library from SparkFun - called "SparkFun LSM6DS3 Breakout" does work without modification - however for the Nano 33 IoT you need to instantiate/create the IMU object using the following command

LSM6DS3 myIMU(I2C_MODE, 0x6A);

The default on the SparkFun IMU is 0x6B. Armed with this knowledge the SparkFun FIFO example works immediately in PlatformIO with the first few lines of code:

#include <Arduino.h>
#include "SparkFunLSM6DS3.h"
#include "Wire.h"
#include "SPI.h"

//LSM6DS3 myIMU( SPI_MODE, 10 );
LSM6DS3 myIMU(I2C_MODE, 0x6A);

void setup( void ) {
 //Over-ride default settings if desired
 myIMU.settings.gyroEnabled = 0;  //Can be 0 or 1

my platform.ini file contains - so you'll need to set the serial baud rate in the example code as well.

[env:nano_33_iot]
platform = atmelsam
board = nano_33_iot
framework = arduino
monitor_speed = 230400

lib_deps =
 SparkFun LSM6DS3 Breakout

Hope this helps as the Arduino example supplied is too simple. I have attached my main.cpp file showing the changed line of code.

main.cpp (5.43 KB)