mirror of
https://github.com/eclipse/upm.git
synced 2025-07-04 02:41:14 +03:00
Added initial interfaces and some sensors implementing them
This commit is contained in:

committed by
Serban Waltter

parent
85608a9f61
commit
e7820f2831
@ -46,3 +46,8 @@ int Moisture::value()
|
||||
{
|
||||
return mraa_aio_read(m_aio);
|
||||
}
|
||||
|
||||
int Moisture::getMoisture()
|
||||
{
|
||||
return value();
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user