mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 15:15:07 +03:00 
			
		
		
		
	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
					Serban Waltter
				
			
				
					committed by
					
						 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
			
				
	
			
			
			 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
						parent
						
							f28a6d2561
						
					
				
				
					commit
					e4f106a0c7
				
			| @@ -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) | ||||
|   | ||||
| @@ -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]; | ||||
| } | ||||
|   | ||||
| @@ -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. | ||||
|              */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user