upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs 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.

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 ( void  )

Gets the sensor status.

Here is the caller graph for this function:

std::string name ( )

Returns the name of the component

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