mirror of
https://github.com/eclipse/upm.git
synced 2025-07-27 06:01:16 +03:00
Added initial interfaces and some sensors implementing them
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
6bf21a23e7
commit
f035470822
@ -28,6 +28,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <mraa/i2c.hpp>
|
||||
#include <interfaces/iHumidity.hpp>
|
||||
#include <interfaces/iTemperature.hpp>
|
||||
|
||||
#define TH02_ADDR 0x40 // device address
|
||||
|
||||
@ -69,7 +71,7 @@ namespace upm {
|
||||
* @image html th02.jpg
|
||||
* @snippet th02.cxx Interesting
|
||||
*/
|
||||
class TH02 {
|
||||
class TH02 : virtual public iHumidity, virtual public iTemperature {
|
||||
public:
|
||||
/**
|
||||
* Instantiates a TH02 object
|
||||
@ -82,14 +84,18 @@ class TH02 {
|
||||
~TH02 ();
|
||||
|
||||
/**
|
||||
* Gets the temperature value from the sensor.
|
||||
* Get the current temperature.
|
||||
*
|
||||
* @return The last temperature reading in Celsius
|
||||
*/
|
||||
float getTemperature ();
|
||||
virtual float getTemperature ();
|
||||
|
||||
/**
|
||||
* Gets the humidity value from the sensor.
|
||||
* Get the current relative humidity.
|
||||
*
|
||||
* @return The last humidity reading
|
||||
*/
|
||||
float getHumidity ();
|
||||
virtual float getHumidity ();
|
||||
|
||||
/**
|
||||
* Gets the sensor status.
|
||||
|
Reference in New Issue
Block a user