I loaded the SimpleAccelerometer.ino sketch (code below) from GitHub onto my nano 33 BLE but the serial monitor says " Failed to Initialize IMU!" which indicates the IMU isn't set up.
Has anybody got this working on the nano 33 BLE/ Sense? What am I missing?
Thanks!
/*
Arduino LSM9DS1 - Simple Accelerometer
This example reads the acceleration values from the LSM9DS1
sensor and continuously prints them to the Serial Monitor
or Serial Plotter.
The circuit:
Arduino Nano 33 BLE Sense
created 10 Jul 2019
by Riccardo Rizzo
This example code is in the public domain.
*/
#include <Arduino_LSM9DS1.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Started");
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU!");
while (1);
}
So I have all libraries tagged with "nano 33 BLE" installed. The SimpleAccelerometer sketch uploads and runs - but gives the "IMU Failed to Initialize!" message on the serial monitor. Perhaps the board is bad?
Also: I have the nano 33 BLE (not Sense) board, but the sketch comments indicate it was created for the nano 33 BLE Sense. I assumed the sketch would work for both models...
Birkedahl:
I have the nano 33 BLE (not Sense) board, but the sketch comments indicate it was created for the nano 33 BLE Sense. I assumed the sketch would work for both models...
That sketch worked for me without modification on a nano 33 BLE. Perhaps it is an issue with your board?
The "Arduino people" had me run the sketch MultiSpeedI2CScanner.ino which shows the board is not reading I2C devices correctly.. So conclusion is a bad board - return it for replacement..