Reference   Language | Libraries | Comparison | Changes

ArduinoHTS221 : HTS class

readTemperature()

Description

Read the temperature sensor’s temperature value.

Syntax

HTS.readTemperature()
HTS.readTemperature(units)

Parameters

units

  • FAHRENHEIT to read the temperature in Farenheit,
  • CELSIUS to read the temperature in Celsius.
    Defaults to CELSIUS, if unit parameter is not provided

Returns

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

Example


  float temperature = HTS.readTemperature();

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

See Also



Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.