Added iGas interface

Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Serban Waltter
2018-10-08 16:43:42 +03:00
committed by Mihai Tudor Panu
parent f28a6d2561
commit e4f106a0c7
33 changed files with 267 additions and 21 deletions

View File

@ -2,4 +2,5 @@ set (libname "micsv89")
set (libdescription "Low-power Air Quality Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iGas.hpp)
upm_module_init(mraa)

View File

@ -66,6 +66,11 @@ float MICSV89::co2equ() {
return ((rx_buf[0] - 13) * (1600/229) + 400);
}
float MICSV89::getConcentration() {
update();
return ((rx_buf[0] - 13) * (1600/229) + 400);
}
int MICSV89::vocshort() {
return rx_buf[1];
}

View File

@ -27,6 +27,8 @@
#include <iostream>
#include <string>
#include <interfaces/iGas.hpp>
namespace mraa { class I2c;}
namespace upm {
@ -59,7 +61,7 @@ namespace upm {
* @image html micsv89.jpg
* @snippet micsv89.cxx Interesting
*/
class MICSV89 {
class MICSV89: virtual public iGas {
public:
/**
* MICSV89 constructor
@ -87,6 +89,11 @@ namespace upm {
*/
float co2equ();
/**
* Returns the CO2 equivalent value.
*/
float getConcentration();
/**
* Returns VOC Short value.
*/