Arduino_HTS221 - readTemperature()

Read the sensor’s measured temperature value.

Syntax

HTS.readTemperature()
HTS.readTemperature(units)

Parameters

  • units: FAHRENHEIT to read the temperature in Fahrenheit and CELSIUS to read the temperature in Celsius. If unit parameter is not provided, default is CELSIUS.

Returns

The temperature in degrees Fahrenheit or Celsius, depending on the units requested.

Example

float temperature = HTS.readTemperature();

Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" °C");

See also