sparkfun / SparkFun_LSM9DS1_Arduino_Library

Arduino library for the LSM9DS1 9DOF IMU.
Other
64 stars 78 forks source link

LSM9DS1 code to measure temperature #18

Closed sauru123 closed 6 years ago

sauru123 commented 6 years ago

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 6 years ago

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.