Hi Ben
Perfect! it's working nice!
The data is from the Accelerometer und Gyro is now ok,
and the program can now dedect, if one or both sensor are connected and save one or both sensor data in a CSV File.
I will still try to read and write the registers but that will take a little more time.
I have noticed two small things, both little things don't bother me:
I think, the text is not correct anymore. The text should now be like this:
return >0 for success and 0 if the device is not responding correctly
and the channel 1 is not in the display,
but it works fine on channel1 without changing anything.
ESP32 and LSM9DS1 not compiling
-
- Valued Contributor
- Posts: 1025
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
-
- Valued Contributor
- Posts: 1025
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
Re: ESP32 and LSM9DS1 not compiling
Hi Ben
There is still a small problem on the component with the temperature reading.
The temperature is displayed from -20000 to -5000 but I suspect this has something to do with the the output of the sensor is 0 (typ) at 25 degrees Celsius. Do you have any idea how this works? maybe I can simply convert this, but what exactly does LSB/C mean?
There is still a small problem on the component with the temperature reading.
The temperature is displayed from -20000 to -5000 but I suspect this has something to do with the the output of the sensor is 0 (typ) at 25 degrees Celsius. Do you have any idea how this works? maybe I can simply convert this, but what exactly does LSB/C mean?
-
- Valued Contributor
- Posts: 1025
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
Re: ESP32 and LSM9DS1 not compiling
Hi to All
It's worse than I expected. It's a 11Bit value but out_temp_H register have 5 times Temp11.
is there a way to read the temperature? how can you convert it into degrees Celsius?
It's worse than I expected. It's a 11Bit value but out_temp_H register have 5 times Temp11.
is there a way to read the temperature? how can you convert it into degrees Celsius?
-
- Matrix Staff
- Posts: 1509
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 211 times
- Been thanked: 350 times
Re: ESP32 and LSM9DS1 not compiling
I'm just going off the datasheet as I'm not familiar with the component or device, so this might be wrong.
LSB/C is the measure of temperature sensitivity. It is 16 least significant bits per degrees C. So 1 degree change with alter the value by 16 bits.
I don't think the 5 values for Temp11 make any problems. Here's the maths:
[edit: I've corrected the offset value from 20 to 25]
LSB/C is the measure of temperature sensitivity. It is 16 least significant bits per degrees C. So 1 degree change with alter the value by 16 bits.
I don't think the 5 values for Temp11 make any problems. Here's the maths:
- Maximum value of the registers will be 0x7FF = 2047. Divide this by 16 = 127.9. Add to 25 gives 152.9°C.
- Minimum value of the registers will be 0xF800 = -2048. Divide by 16 = -128. Add to 25 gives -103°C.
- A register value of 0x0000 is 0. Divide by 16 = 0. Add to 25 gives 25°C.
[edit: I've corrected the offset value from 20 to 25]
-
- Valued Contributor
- Posts: 1025
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
Re: ESP32 and LSM9DS1 not compiling
Hi Seb
The data is from an ESP32 send by bluetooth or USB, received as array, in the AppDeveloper. So the chart are from the AppDeveloper.
I have a demo for the chart and a practical addition for the charts.
With printscreen (macro) you can automatically save the chart (results) as .png files.
Start the app with F5.
If you want, switch on the printscreen macro and then view the .png file on your computer C:\All_export\.
regards
Stefan
AppDeveloper Program
The data is from an ESP32 send by bluetooth or USB, received as array, in the AppDeveloper. So the chart are from the AppDeveloper.
I have a demo for the chart and a practical addition for the charts.
With printscreen (macro) you can automatically save the chart (results) as .png files.
Start the app with F5.
If you want, switch on the printscreen macro and then view the .png file on your computer C:\All_export\.
regards
Stefan
AppDeveloper Program
-
- Valued Contributor
- Posts: 1025
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
-
- Valued Contributor
- Posts: 1025
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 194 times
- Been thanked: 218 times
Re: ESP32 and LSM9DS1 not compiling
Hi Steve
Yes you are right, you have divid by 16 and add the temperatur value of 0x0000, for this IC it is 25 degrees.
I saved the temperature values in an Excel file. (Not calculated value)
However, the values were much higher as you wrote. So I used the DEZINHEX() function in Excel. Result was suspected that Hbyte and Lbyte are swaped.
Excel: So I also swap the Value from the temperatur and made a calculation.
For me it's practical if I use all values as signed integer.
For the temperature I calculate x100 and I have to divide it by 100 again later in excel, but in excel I have decimal numbers with decimal places. For me, the only wish would be to swap Hbyte and Lbyte in the component for the temperature.
or you can leave it as it is
Excel with temperatur x 100, for the test heat up the LSM9DS1 swap is a macro from me:
Yes you are right, you have divid by 16 and add the temperatur value of 0x0000, for this IC it is 25 degrees.
I saved the temperature values in an Excel file. (Not calculated value)
However, the values were much higher as you wrote. So I used the DEZINHEX() function in Excel. Result was suspected that Hbyte and Lbyte are swaped.
Excel: So I also swap the Value from the temperatur and made a calculation.
For me it's practical if I use all values as signed integer.
For the temperature I calculate x100 and I have to divide it by 100 again later in excel, but in excel I have decimal numbers with decimal places. For me, the only wish would be to swap Hbyte and Lbyte in the component for the temperature.
or you can leave it as it is
Excel with temperatur x 100, for the test heat up the LSM9DS1 swap is a macro from me:
-
- Matrix Staff
- Posts: 1509
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 211 times
- Been thanked: 350 times
Re: ESP32 and LSM9DS1 not compiling
stefan.erni wrote: ↑Thu Jun 06, 2024 1:59 pmYes you are right, you have divid by 16 and add the temperatur value of 0x0000, for this IC it is 25 degrees.
Thanks, Stefan. I have corrected my post to use the offset 25.
And I will ask for the component to be fixed so that the return bytes are the correct way around.
-
- Matrix Staff
- Posts: 1988
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 630 times
- Been thanked: 660 times
Re: ESP32 and LSM9DS1 not compiling
hi Stefan
I hopefully have fixed the component for you.
To try the component.
Browse to this location using file explorer , it's hidden by default so just paste the link into your address bar.
Place the attached component.
If Flowcode is already open, then you will need to reload your project for the new component to work
If you run any component updates, then the component you added will be overwritten, so it will stop working again (unless the component update has been pushed).
Can you let me know if it now works, please?
I hopefully have fixed the component for you.
To try the component.
Browse to this location using file explorer , it's hidden by default so just paste the link into your address bar.
Code: Select all
C:\ProgramData\MatrixTSL\FlowcodeV10\Components
If Flowcode is already open, then you will need to reload your project for the new component to work
If you run any component updates, then the component you added will be overwritten, so it will stop working again (unless the component update has been pushed).
Can you let me know if it now works, please?
- Attachments
-
- LSM9DS1_AccelGyroMagnet.fcpx
- (8.6 KiB) Downloaded 388 times
Martin