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
@@ -46,3 +46,8 @@ int GroveMoisture::value()
|
||||
{
|
||||
return mraa_aio_read(m_aio);
|
||||
}
|
||||
|
||||
int GroveMoisture::getMoisture()
|
||||
{
|
||||
return value();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <mraa/aio.h>
|
||||
#include <interfaces/iMoisture.hpp>
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
@@ -56,7 +57,7 @@ namespace upm {
|
||||
* @image html grovemoisture.jpg
|
||||
* @snippet grovemoisture.cxx Interesting
|
||||
*/
|
||||
class GroveMoisture {
|
||||
class GroveMoisture : virtual public iMoisture {
|
||||
public:
|
||||
/**
|
||||
* Grove analog moisture sensor constructor
|
||||
@@ -75,6 +76,13 @@ namespace upm {
|
||||
*/
|
||||
int value();
|
||||
|
||||
/**
|
||||
* Gets the moisture value from the sensor
|
||||
*
|
||||
* @return Moisture reading
|
||||
*/
|
||||
virtual int getMoisture();
|
||||
|
||||
private:
|
||||
mraa_aio_context m_aio;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user