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

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;
upm::TH02 sensor;
while (!doWork) {
temperature = sensor.getTemperature();
humidity = sensor.getHumidity();
std::cout << "Temperature = " << temperature << ", Humidity = " << humidity << std::endl;
upm_delay_us(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 ( )
inline

Returns the name of the component


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