SHT21
class SHT21
Driver for SHT21 I2C temperature and humidity sensor. More...
Public Functions
Type
Name
SHT21 (I2C * i2c)
float
readTemp ()
float
readHumidity ()
int
reset ()
int
setPrecision (char precision)
Detailed Description
SHT21 Connection class, utilizing a I2C interface Example:
Public Functions Documentation
function SHT21
Constructor - create a connection to a SHT21 temperature and humidity sensor through an I2C interface
Parameters:
*i2c a pointer to the i2c interface that is used for communication
frequency - I2C frequency
function readTemp
Read the temperature value from the sensor Involves triggering the measuring unit then waiting for 100ms for the measuring to complete before reading the temperature
Parameters:
returns a value representing the temperature in degrees centigrade
function readHumidity
Read the humidity value from the sensor Involves triggering the measuring unit then waiting for 100ms for the measuring to complete before reading the humidity
Parameters:
returns the percentage humidity
function reset
Perform a soft-reset of the sensor unit.
function setPrecision
Set the precision of the measuring //Data precision settings //RH 12 T 14 - default
define SHT_PREC_1214 0x00
//RH 8 T 10
define SHT_PREC_0812 0x01
//RH 10 T 13
define SHT_PREC_1013 0x80
//RH 11 T 11
define SHT_PREC_1111 0x81
Parameters:
precision - the precision, refer to above or datasheet.
The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/SHT21\_ncleee.h
Last updated