mirror of
https://github.com/eclipse/upm.git
synced 2025-07-17 01:01:11 +03:00
Added Initial interface implementations
This commit is contained in:

committed by
Stefan Andritoiu

parent
6228498147
commit
3572a176c2
@ -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);
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user