diff --git a/docs/api.md b/docs/api.md index 5eaaada..d21f06a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -346,16 +346,16 @@ Reads the temperature from the sensor (Celsius). #### Syntax ``` -IMU.readTemperature() +IMU.readTemperature(temperature_deg) ``` #### Parameters -None. +* _temperature_deg_: int variable where the temperature value will be stored. #### Returns -The temperature in Celsius. +None. #### Example @@ -371,6 +371,38 @@ if (IMU.temperatureAvailable()) } ``` +### `readTemperatureFloat()` + +Reads the temperature from the sensor (Celsius). + +#### Syntax + +``` +IMU.readTemperatureFloat(temperature_deg) +``` + +#### Parameters + +* _temperature_deg_: float variable where the temperature value will be stored. + +#### Returns + +None. + +#### Example + +``` +if (IMU.temperatureAvailable()) + { + float temperature_deg = 0.0f; + IMU.readTemperatureFloat(temperature_deg); + + Serial.print("LSM6DSOX Temperature = "); + Serial.print(temperature_deg); + Serial.println(" °C"); + } +``` + ### `temperatureAvailable()` Checks if temperature data is available. @@ -401,4 +433,4 @@ if (IMU.temperatureAvailable()) Serial.print(temperature_deg); Serial.println(" °C"); } -``` \ No newline at end of file +```