Added Initial interface implementations

This commit is contained in:
UPSquared
2018-05-31 17:21:00 +03:00
committed by Stefan Andritoiu
parent 6228498147
commit 3572a176c2
102 changed files with 1072 additions and 183 deletions

View File

@ -62,6 +62,11 @@ int Temperature::value ()
return (int) round(t);
}
float Temperature::getTemperature ()
{
return value();
}
float Temperature::raw_value()
{
return (float) mraa_aio_read(m_aio);

View File

@ -28,6 +28,7 @@
#include <string>
#include <mraa/aio.hpp>
#include <interfaces/iTemperature.hpp>
namespace upm {
/**
@ -58,7 +59,7 @@ namespace upm {
* @image html temp.jpg
* @snippet temperature.cxx Interesting
*/
class Temperature {
class Temperature : virtual public iTemperature {
public:
/**
* Analog temperature sensor constructor
@ -96,6 +97,13 @@ class Temperature {
* @return Normalized temperature in Celsius
*/
int value();
/**
* Gets the temperature in Celsius from the sensor
*
* @return Normalized temperature in Celsius
*/
virtual float getTemperature();
private:
mraa_aio_context m_aio;
float m_scale;