Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the library for internal and external LSM9DS1 #14

Open
gswonk opened this issue Dec 21, 2020 · 13 comments
Open

Using the library for internal and external LSM9DS1 #14

gswonk opened this issue Dec 21, 2020 · 13 comments

Comments

@gswonk
Copy link

gswonk commented Dec 21, 2020

The BLE Sense has an internal IMU. I need an additional one at a different address.
Both SparkFun and Adafruit sell an external version.

Does this library support the alternate address of an additional IMU?

@FemmeVerbeek
Copy link
Owner

Somebody used it on an external IMU using a classic Aduino UNO with only 5% of the memory, so yes it can be done. I don't know if he had to modify any internal register addresses.

@gswonk
Copy link
Author

gswonk commented Feb 1, 2021 via email

@FemmeVerbeek
Copy link
Owner

I'm not a specialist on the I2C busses. AFAIK that communication is in the wire library.

@gswonk
Copy link
Author

gswonk commented Feb 1, 2021 via email

@FemmeVerbeek
Copy link
Owner

I'll probably never use it myself, but perhaps for others reading this.

@gswonk
Copy link
Author

gswonk commented Feb 6, 2021 via email

@FemmeVerbeek
Copy link
Owner

Hi Glenn,
Correct, and yes that's how to disable the gyro. There are three operational modes 0=off , 1= Accel only , 2= Gyro +Accel, see int getOperationalMode();
When both are working they always share the same ODR.

Note that the ODR values in the documentation tables are not acurate, not good enough for navigation purposes. The library measures the actual ODR at every setting change and stores it internally, but this was not designed to serve multiple IMU's. If you need the acurate number per IMU, you must store it yourelf. You can get the values by calling getAccelODR() getGyroODR() and getMagnetODR()

Femme

@gswonk
Copy link
Author

gswonk commented Feb 7, 2021 via email

@FemmeVerbeek
Copy link
Owner

No, sorry. The LSM9DS1 is a big seller. If the specs are good enough for you it is probably a good choise. The ODR is a bit disappointing. The makers promised 952Hz, but in reality it is closer to 500Hz. They say you need 2000 for drone flight orientation.

@gswonk
Copy link
Author

gswonk commented Feb 7, 2021 via email

@gswonk
Copy link
Author

gswonk commented Feb 7, 2021 via email

@FemmeVerbeek
Copy link
Owner

It does not make sense to me.
The declaration you refer to is in the private section, so IMUexternal should not be visible outside the library.
Didn't you forget to init the new Object?
The idea of OOP is that you reuse code, not rewrite it.
The library predeclares and inits one object of the LSM9DS1Class called IMU.

If you want to use a second chip you should declare it yourself in your sketch.
e.g.
#ifndef ARDUINO_ARDUINO_NANO33BLE
LSM9DS1Class IMUexternal(Wire);
IMUexternal.begin(); // don't forget to init your object.
...
...

#endif

That should give you two objects
IMU which was already predeclared connected to Wire1
IMUexternal connected to Wire

@gswonk
Copy link
Author

gswonk commented Feb 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants