upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
TH02 Class Reference

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

Detailed Description

This module defines the TH02 interface for libth02

Note: For use on Intel(R) Edison with an Arduino* breakout board, Intel Edison must be set to 3 V rather than 5 V.

th02.jpg
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 (int bus=0, uint8_t addr=TH02_ADDR)
 
 ~TH02 ()
 
float getTemperature ()
 
float getHumidity ()
 
bool getStatus ()
 
std::string name ()
 

Constructor & Destructor Documentation

TH02 ( int  bus = 0,
uint8_t  addr = TH02_ADDR 
)

Instantiates a TH02 object

~TH02 ( )

TH02 object destructor; basically, it closes the I2C connection.

Member Function Documentation

float getTemperature ( void  )

Gets the temperature value from the sensor.

Here is the call graph for this function:

float getHumidity ( void  )

Gets the humidity value from the sensor.

Here is the call graph for this function:

bool getStatus ( )

Gets the sensor status.

Here is the caller graph for this function:

std::string name ( )
inline

Returns the name of the component


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