Files | |
file | htu21d.h |
HTU21D Temperature and Humidity Sensor. | |
Functions | |
KSensorStatus | htu21d_setup (void) |
Setup the I2C interface for talking with the HTU21D. More... | |
KSensorStatus | htu21d_read_temperature (float *temp) |
Sends temperature command and reads back temperature data. More... | |
KSensorStatus | htu21d_read_humidity (float *hum) |
Sends humidity command and reads back humidity data. More... | |
KSensorStatus | htu21d_reset (void) |
Sends reset command which powers sensor off and on again. More... | |
Function Documentation
KSensorStatus htu21d_read_humidity | ( | float * | hum | ) |
Sends humidity command and reads back humidity data.
- Parameters
-
hum pointer to relative humidity in percentage (0.0 - 100.0)
- Returns
- KSensorStatus, SENSOR_OK on success, SENSOR_ERROR, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus htu21d_read_temperature | ( | float * | temp | ) |
Sends temperature command and reads back temperature data.
- Parameters
-
temp pointer to temperature in celsius (-40.0 to 125.0)
- Returns
- KSensorStatus, SENSOR_OK on success, SENSOR_ERROR, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus htu21d_reset | ( | void | ) |
Sends reset command which powers sensor off and on again.
- Returns
- KSensorStatus, SENSOR_OK on success or SENSOR_WRITE_ERROR on error
KSensorStatus htu21d_setup | ( | void | ) |
Setup the I2C interface for talking with the HTU21D.
- Returns
- KSensorStatus, SENSOR_OK on success or SENSOR_WRITE_ERROR on error