ESP32 and LSM9DS1 not compiling

For general Flowcode discussion that does not belong in the other sections.
stefan.erni
Valued Contributor
Posts: 758
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi to All

There is a nice Breakoutboard wit a LSM9DS1 and two qwii connector.
Adafruit LSM9DS1 Accelerometer + Gyro + ... F Breakout

It's working with FC10 on an ESP32 simple and stable.
Another big advantage is that two sensors can be connected with one cable and the address of the second sensor can be changed with two small solder bridges. FC10 supports both addresses very comfortable. Also a long Qwii cable can go to the first board and from there a short Qwii cable to the second board. Each board has two Qwii connectors.

Unfortunately, there are two problems

1.
After saving and opening the project, the information about the channel of the LSM9ds1 is lost. This is not pleasant, especially with several LSM9ds1s.
2.
The 16 bit values from the Accelerometer/Gyro are in the wrong order, high byte and low byte are swapped. So I have to swap them myself back.
(Magnetometer is correct)

Maybe that can be improved and it would be a very practical component

regards

Stefan

Swap the A/G byte order:
Snag_56a23de.png
Snag_56a23de.png (37.82 KiB) Viewed 268 times

choose Ground if you use the bridge to ground:
Snag_561792d.png
Snag_561792d.png (49.33 KiB) Viewed 268 times
Just solder a bridge:
Snag_55fd87d.png
Snag_55fd87d.png (754.97 KiB) Viewed 268 times

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Thanks for the information, Stefan.
We will look into this and sort it out for you as soon as we can.
Martin

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

At this opportunity:
I have another small problem.
If I connect both LSM9DS on one bus, all 18 axes work perfectly.
But if only one LSM9DS is connected I want to know which one.
I tried to evaluate the return value from initialize the component
but no matter if the LSM9DS is connected or not, the return value is always 0.
With the MPU6886 this works very well.

So I tried to read a register from the LSM9DS.
Register 15 should always return the value 61 at the AG or 104 M.
But both times it reads the register from the first LSM9DS used. There is something small wrong

regards
Stefan

How I did it when the ret_byte were always 0:
Attachments
Snag_6dbcb66.png
Snag_6dbcb66.png (111.65 KiB) Viewed 261 times

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

I tried to make a macro to read the register values. I want to use it to read the values and change them later, for example to switch filters on or off.
But I have a little problem with the I2C master. Do I have to initialize the transaction and then deinitialize it again?
And is the I2C master the right component for this?

Init all:
Snag_2ad9d613.png
Snag_2ad9d613.png (31.9 KiB) Viewed 223 times
use the macro:
Snag_2ada3162.png
Snag_2ada3162.png (105.21 KiB) Viewed 223 times
Attachments
LSM_read.fcm
(7.83 KiB) Downloaded 12 times

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

I still have small problems with the sensor and also with the I2C bus to read and write the registers.

regards

Stefan

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Thanks Stefan.
Sorry for the delay, this has slipped under the net.
I will see if I can find out what's going on.
Martin

Post Reply