Showing results for 
Search instead for 
Did you mean: 

Error in Reading temperature using Lis3dh



Hi everyone,


I have an STM32L4 series-based board with an embedded LIS3DH sensor. I've written code to read temperature values from it, configuring all settings as per the datasheet. However, I'm having trouble obtaining the exact temperature value from the ADC3_L registers. Below I attach the code also:

1. I am enabling the temp sensor and after I am using LIS_read_ADC function to get the value stored on it.


Federica Bossi
ST Employee

Hi @AKH ,

Welcome to ST Community!

I suggest you to look at our PID examples on Github where you can find how to get the temperature output.

Let me know if this helps you.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.