LSM6DSO32 library slow

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Simon88
 
Posts: 10
Joined: Wed Mar 24, 2021 2:40 pm

LSM6DSO32 library slow

Post by Simon88 »

Hi all,

I'am playing with an LSM6DSO32 with an SAMD21 and I use Adafruit library for LSM6DSO32 https://github.com/adafruit/Adafruit_LSM6DS but it's verry slow I have 3ms delay for this line of code :

Code: Select all

SerialUSB.println(millis());
dso32.getEvent(&accel_dso, &gyro_dso, &temp_dso);
SerialUSB.println(millis()); //3ms here just to read register and do some math....

this is huge no ?? Is it notmal ? My sensor is set to 416Hz data rate by

Code: Select all

LSM6DS_RATE_416_HZ
mask.
So I can't run my code up to 333Hz because in each loop iteration I have a minimum of 3ms just for getEvent...

Edit : for information I set my i2c to high speed with

Code: Select all

Wire.setClock(400000UL);

User avatar
Simon88
 
Posts: 10
Joined: Wed Mar 24, 2021 2:40 pm

Re: LSM6DSO32 library slow

Post by Simon88 »

EDIT : I searched and I found the line where is "slow", in _read file LSM6DSO32.cpp

Code: Select all

  SerialUSB.println(millis());
  uint8_t buffer[14];
  data_reg.read(buffer, 14);
  SerialUSB.println(millis());
So here I have 2-3ms just for read register.... Is it normal?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”