SHT1X Class
- ID: sht1x
- Name: Temperature and Humidity Sensor
- Category: temp
- Manufacturer: dfrobot
- Link: https://www.dfrobot.com/wiki/index.php/SHT1x_Humidity_and_Temperature_Sensor_(SKU:_DFR0066)
- Connection: gpio
This driver was tested with a DFRobot SHT10 Temperature and Humidity sensor. This driver should work on all SHT1X devices.
It requires a 10K pull-up resistor connected to the data pin. The sensor can be run at differing voltages from 2.5v to 5v.
Item Index
Methods
SHT1X
-
clk_pin
-
data_pin
SHT1X object constructor
Parameters:
-
clk_pin
NumberSpecify the GPIO pin to use for the clock.
-
data_pin
NumberSpecify the GPIO pin to use for data.
Returns:
reset
()
Perform a soft reset of the device.
update
()
Query the device and store the latest values. You must call this function before querying the temperature or the humidity.
getTemperature
()
Number
Query the temperature in degrees Celsius. update() must have been called prior to calling this function.
Returns:
The temperature in Celsius
getHumidity
()
Number
Query the relative humidity. update() must have been called prior to calling this function.
Returns:
The relative humidity.
readStatus
()
Number
Read the status register.
Returns:
The contents of the status register.
writeStatus
-
status
Write a value to the status register.
Parameters:
-
status
NumberThe uint8_t to write to the register.
Returns:
UPM result
setVolts
-
volts
The Vdd voltage the sensor is being driven at can affect the temperature measurements. This function allows you to specify a voltage as close as you are using to power the sensor, so that the appropriate compensation can be made. By default, the coefficients are set for 5v operation.
Parameters:
-
volts
SHT1X_VOLTS_TOne of the SHT1X_VOLTS_T values.