Arduino_LSM6DSOX - readTemperature()

Reads the temperature from the sensor (Celsius).

Syntax

IMU.readTemperature()

Parameters

None.

Returns

The temperature in Celsius.

Example

if (IMU.temperatureAvailable())
  {
    int temperature_deg = 0;
    IMU.readTemperature(temperature_deg);

    Serial.print("LSM6DSOX Temperature = ");
    Serial.print(temperature_deg);
    Serial.println(" °C");
  }