Sht3x
Description
The Sht3x object implements a driver for the I2C-based SHT3x humidity and temperature sensor. The parent of a Sht3x object has to be a corresponding I2cBus object.
All measurements are polled with high repeatability, leading to best accuracy. The measurement properties are updated approximately 20 ms after they got polled, i.e. a measurement has been initiated.
This object was introduced in InCore 2.0.
- › Inherits:
Overview
Properties
Methods
Signals
Properties
humidity
This property holds the last polled humidity value. When polling this property, the temperature is polled and updated automatically as well.
- › Type:
Float
- › Signal:
humidityChanged()
- › Attributes:
Readonly, Requires Polling
temperature
This property holds the last polled temperature value. When polling this property, the humidity is polled and updated automatically as well.
- › Type:
Float
- › Signal:
temperatureChanged()
- › Attributes:
Readonly, Requires Polling
Methods
pollHumidity()
This method polls the humidity property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollTemperature()
This method polls the temperature property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
Example
import InCore.Foundation 2.5
import InCore.IO 2.5
Application {
FtdiI2cBus {
Sht3x {
id: sht
address: 0x44
Polling on temperature { interval: 100 }
onTemperatureChanged: console.log(Math.floor(temperature*10) / 10, "°C -",
Math.floor(humidity*10) / 10, "% r.h.")
}
}
}