Adafruit_LIS3DH icon indicating copy to clipboard operation
Adafruit_LIS3DH copied to clipboard

Temperature measurement

Open giukio opened this issue 3 years ago • 1 comments

Hello Adafruit Community, I added a couple of functions to enable the temperature measurement baked in the ADC3 of the LIS3DH with an example on how to use them.

bool enableTemperature(bool enable_temp); connects or disconnects the temperature sensor to the ADC3 channel.

int8_t readTemperature(int8_t reference); checks first whether the temperature measurement is enabled, and if it is, returns a temperature in °C. A known limitation of the LIS3DH is the lack of an absolute temperature measurement, in fact the datasheet specifies that the internal temperature is a delta T with respect to an unknown reference. This is the reason a reference temperature is needed as parameter, 13°C was just my best guess.

Kind regards, Giulio

giukio avatar Dec 26 '21 15:12 giukio