Added initial interfaces and some sensors implementing them

This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Serban Waltter
parent 85608a9f61
commit e7820f2831
102 changed files with 1183 additions and 182 deletions

View File

@ -46,3 +46,8 @@ int Moisture::value()
{
return mraa_aio_read(m_aio);
}
int Moisture::getMoisture()
{
return value();
}

View File

@ -25,6 +25,7 @@
#include <string>
#include <mraa/aio.h>
#include <interfaces/iMoisture.hpp>
namespace upm {
/**
@ -55,7 +56,7 @@ namespace upm {
* @image html moisture.jpg
* @snippet moisture.cxx Interesting
*/
class Moisture {
class Moisture : virtual public iMoisture {
public:
/**
* Analog moisture sensor constructor
@ -74,6 +75,13 @@ namespace upm {
*/
int value();
/**
* Gets the moisture value from the sensor
*
* @return Moisture reading
*/
virtual int getMoisture();
private:
mraa_aio_context m_aio;
};