upm  0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions
TH02 Class Reference

C++ API for TH02 chip (Temperature and Humidity Sensor Pro) More...

Detailed Description

This file defines the TH02 C++ interface for libth02

float temperature = 0.0;
float humidity = 0.0;
sensor = new upm::TH02 ();
while (!doWork) {
temperature = sensor->getTemperature ();
// humidity = sensor->getHumidity ();
std::cout << "Temperature = " << temperature << ", Humidity = " << humidity << std::endl;
usleep (500000);
}

Public Member Functions

 TH02 ()
 
 ~TH02 ()
 
float getTemperature ()
 
float getHumidity ()
 
bool getStatus ()
 
std::string name ()
 

Constructor & Destructor Documentation

TH02 ( )

Instanciates a TH02 object

~TH02 ( )

TH02 object destructor, basicaly it close i2c connection.

Member Function Documentation

float getTemperature ( )

Get the temperature value from sensor.

Here is the call graph for this function:

float getHumidity ( )

Get the humidity value from sensor.

Here is the call graph for this function:

bool getStatus ( )

Get the sensor's status.

Here is the caller graph for this function:

std::string name ( )
inline

Return name of the component


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