upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the HDC1000 Temperature & Humidity Sensor. More...

Detailed Description

Description in web-link above: The HDC1000 is a digital humidity sensor with integrated temperature sensor that provides excellent measurement accuracy at very low power. The device measures humidity based on a novel capacitive sensor. The humidity and temperature sensors are factory calibrated. The innovative WLCSP (Wafer Level Chip Scale Package) simplifies board design with the use of an ultra-compact package. The sensing element of the HDC1000 is placed on the bottom part of the device, which makes the HDC1000 more robust against dirt, dust, and other environmental contaminants. The HDC1000 is functional within the full -40 to +125 [degC] temperature range.

std::cout << "Initializing test-application..." << std::endl;
// Instantiate an HDC1000 instance on bus 1
upm::HDC1000 mySensor(1);
// update and print available values every second
while (run) {
std::cout << "Humidity: " << mySensor.getHumidity(true) << std::endl
<< "Temperature: " << mySensor.getTemperature(true) << std::endl;
std::cout << std::endl;
upm_delay(1);
}
std::cout << "Exiting test-application..." << std::endl;

Public Member Functions

 HDC1000 (int bus, int devAddr=HDC1000_i2C_ADDRESS)
 
int checkID (void)
 
void resetSensor (void)
 
void sampleData (void)
 
float getHumidity (int bSampleData=false)
 
float getTemperature (int bSampleData=false)
 

Constructor & Destructor Documentation

HDC1000 ( int  bus,
int  devAddr = HDC1000_i2C_ADDRESS 
)

Instantiates an HDC1000 object

Parameters
busNumber of the used bus
devAddrAddress of the used I2C device

Here is the call graph for this function:

Member Function Documentation

int checkID ( void  )

Check device_id of sensor

Returns
0 on succes -1 on error

Here is the caller graph for this function:

void resetSensor ( void  )

Performs a soft reset of the HDC1000 device to ensure it is in a known state.

Here is the caller graph for this function:

void sampleData ( void  )

Initiates a temperature/pressure mesasurement and waits to complete.

Here is the call graph for this function:

Here is the caller graph for this function:

float getHumidity ( int  bSampleData = false)

Get the current measured humidity [RH]

Parameters
bSampleDataFlag to read sensor
Returns
The humidity sensor temp in degC

Here is the call graph for this function:

float getTemperature ( int  bSampleData = false)

Get the humidity cell temperature [degC]

Parameters
bSampleDataFlag to read sensor
Returns
The humidity sensor temp in degC

Here is the call graph for this function:


The documentation for this class was generated from the following files: