LSM9DS1 code to measure temperature
sauru123 opened this issue · 1 comments
sauru123 commented
Hi! currently im working on a project in which im using LSM9DS1 and according to datasheet LSM9DS1 can be used as "Embedded temperature sensor" so anyone can help me out with the code for measuring the temperature
Grahldg commented
Hello! There is a function to read the temperature included in the LSM9DS1 Arduino Library that you can call once you've created an instance of the LSM9DS1 class. It should look something like this:
#include <SparkFunLSM9DS1.h>
LSM9DS1 imu;
void setup(){
...
}
void loop(){
if( imu.tempAvailable() ){ // Update when new sensor data is available
imu.readTemp(); // Read the temperature
}
}
If you have further questions and need more immediate assistance, please contact our Technical Assistance Team.