How to change sample rate for a sensor (LSM6DSOX) with Arduino Due code

dyso, I have tried your code also, but nothing happens. It is the wrong library for this sensor.

I was wondering what process consumes all the data. Is that just for you to read (not sure why you would need hundreds of kHz your eyes are not fast enough :slight_smile: ) or is there a computer program listening for that data ?

Hmm there should not be any program or process interrupting or running simultaneously with the Arduino code and data obtaining. I only have my mail and excel running in the background. But know I also have another problem. I made the serial monitor sample with a frequency around 5.5kHz, but all samples are either zero or 21 for all values, and it will not react to the sensor with this sampling frequency…

#include <Adafruit_LSM6DSOX.h>
#include <Wire.h>

Adafruit_LSM6DSOX sox;
void setup(void) {
  Wire.setClock(400000);              // 400000 Fast Mode.
  while (!Serial)
    //delay(1); // will pause Zero, Leonardo, etc until Serial console opens


  if (!sox.begin_I2C()) {


void loop() {

  //  /* Get a new normalized sensor event */
  sensors_event_t accel;
  sensors_event_t gyro;
  sensors_event_t temp;
  sox.getEvent(&accel, &gyro, &temp);

Serial.print(accel.acceleration.x, 3);
//Serial.print(accel.acceleration.y, 3);
//Serial.print(accel.acceleration.z, 2);

Can someone give this an explanation?