Added initial interfaces and some sensors implementing them

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Mihai Tudor Panu
parent 6bf21a23e7
commit f035470822
102 changed files with 1183 additions and 182 deletions

View File

@ -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.