Package com.diozero.devices
Class HTS221
- java.lang.Object
-
- com.diozero.devices.HTS221
-
- All Implemented Interfaces:
DeviceInterface
,HygrometerInterface
,SensorInterface
,ThermometerInterface
,AutoCloseable
public class HTS221 extends Object implements ThermometerInterface, HygrometerInterface
STMicroelectronics HTS221 "ultra compact sensor for relative humidity and temperature". Datasheet: http://www2.st.com/content/ccc/resource/technical/document/datasheet/4d/9a/9c/ad/25/07/42/34/DM00116291.pdf/files/DM00116291.pdf/jcr:content/translations/en.DM00116291.pdf
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this devicefloat
getRelativeHumidity()
Get the relative humidity in percent.float
getTemperature()
Get temperature (degrees C).
-
-
-
Constructor Detail
-
HTS221
public HTS221()
-
HTS221
public HTS221(int controller, int address) throws RuntimeIOException
- Throws:
RuntimeIOException
-
-
Method Detail
-
getRelativeHumidity
public float getRelativeHumidity()
Description copied from interface:HygrometerInterface
Get the relative humidity in percent.- Specified by:
getRelativeHumidity
in interfaceHygrometerInterface
- Returns:
- The relative humidity in percent.
-
getTemperature
public float getTemperature()
Get temperature (degrees C).- Specified by:
getTemperature
in interfaceThermometerInterface
- Returns:
- Temperature in degrees C.
-
close
public void close()
Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
-
-