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

@ -70,6 +70,11 @@ MLX90614::readAmbientTempC(void) {
return readTemperature(MLX90614_TA);
}
float
MLX90614::getTemperature() {
return readAmbientTempC();
}
/*
* **************
* private area

View File

@ -25,6 +25,7 @@
#include <string>
#include <mraa/i2c.hpp>
#include <interfaces/iTemperature.hpp>
#define DEVICE_ADDR 0x5A // device address
@ -73,7 +74,7 @@ namespace upm {
* @image html mlx90614.jpg
* @snippet mlx90614.cxx Interesting
*/
class MLX90614 {
class MLX90614 : virtual public iTemperature {
public:
/**
@ -109,6 +110,13 @@ class MLX90614 {
*/
float readAmbientTempC(void);
/**
* Returns the temperature in degrees Celsius
*
* @return The Temperature in degrees Celsius
*/
virtual float getTemperature();
/**
* Returns the name of the component
*/