-
Notifications
You must be signed in to change notification settings - Fork 17
Add basic examples #8
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
Conversation
|
Hi @Benhalor , |
|
Dear @Benhalor @cparata The are really useful contributions. I have been using this library with Adafruit Feather STM32F405 Express and Adafruit LSM6DSOX + LIS3MDL - Precision 9 DoF IMU - STEMMA QT / Qwiic. And making some progress, but it's goo to see the code from others. I haven't tried the Fifo mode yet. It is really useful to see your code. I will upload what I have working later. |
|
Hi @cparata |
|
Hi @Benhalor , |
|
Hi @cparata, Ok, I could add some comments to the example to explain how to use the LSM6DSOX with a nulceo board. Just to be sure : the default I2C pins are D15 / D14 right ? Improving the sensor interface would be great! The classic arduino way to declare a sensor, is just calling a default construcor "LSM6DSOXSensor lsm6dsoxSensor". Then as you said, the sensor would be started with a "lsm6dsoxSensor.begin(&Wire)" or sm6dsoxSensor.begin(&spi, cs, 2000000)". |
|
As requested I have uploaded my existing code. It's not the best in the world. It needs more error checking, but it does work. My next step is to extend it to multiple IMU sensor and multiple fusions and improve the error detection as in @Benhalor version |
Yes, indeed. Actually, I prefer to leave the constructors as they are, because I think that the driver APIs must be completely agnostic about the used bus (I2C or SPI). I'm going to update the LSM6DSOX library with the new (begin/end) APIs. If you can test it with your setup and update your PR, it would be great! Then I have to update all MEMS sensors libraries and examples in order to be compliant with the new philosophy. Please, give a look to the new README that I'm going to update for the usage of the library. |
Yes D15 and D14 are the Nucleo pins respectively for I2C SCL and I2C SDA. |
|
I updated the LSM6DSOX library in the master repo adding begin/end APIs. |
|
Hi @cparata Thanks for adding begin/end interface. The last commit is working successfully on my setup, using the begin method. For the wiring with a Nucleo board : is there an integrated pull-up resistor ? Best regards, |
|
Hi @Benhalor , |
|
Hi @cparata |
|
Hi @Benhalor , |
|
Hi @Benhalor, thanks for the examples. This put in on the right track, specially with FIFO implementation.
Regards, Álvaro |
|
Hi @Benhalor , |
|
I added the Hello World example, so I can close this PR. Thanks for contribution! |
Hello,
Having spend somes hours to understand the basics, I hope this example might help beginners to start with this powerful library.
Best regards,