Arduino_LSM6DS3 icon indicating copy to clipboard operation
Arduino_LSM6DS3 copied to clipboard

[AE-199] Example sketches do not pass at IMU.begin()

Open aliphys opened this issue 1 year ago • 1 comments

I have compiled and uploaded the three following sketches, on two different laptops:

In all cases, the examples are compiled and uploaded without error. However, there is no output to the Serial monitor at all.

However, if Serial.println("Hello! 1") and Serial.println("Hello! 2") is added to the SimpleAccelerometer.ino sketch as follows:

void setup() {
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Hello! 1");
  if (!IMU.begin()) {
    Serial.println("Failed to initialize IMU!");

    while (1);
  }
 Serial.println("Hello! 2");

  Serial.print("Accelerometer sample rate = ");
  Serial.print(IMU.accelerationSampleRate());
  Serial.println(" Hz");
  Serial.println();
  Serial.println("Acceleration in g's");
  Serial.println("X\tY\tZ");
}

Then only Serial.println("Hello! 1") is printed to the Serial monitor.

The latest version of the library 2640521 was used, with the following command in Windows.

arduino-cli compile -u -p COM7 --fqbn arduino:samd:nano_33_iot --library ".\"  ".\examples\SimpleGyroscope\SimpleGyroscope.ino"

I would expect the code to continue past !IMU.begin(), giving an error if it fails to initialise.

aliphys avatar Nov 09 '23 17:11 aliphys

Possibly related to

  • https://github.com/arduino-libraries/Arduino_LSM6DS3/issues/20

This issue also affects the tutorial for the Nano 33 IoT Accelerometer in the Docs website: https://github.com/arduino/docs-content/blob/main/content/hardware/03.nano/boards/nano-33-iot/tutorials/imu-accelerometer/content.md

aliphys avatar Nov 09 '23 17:11 aliphys