Grove Air Quality Sensor.

Fork of Grove_Air_Quality_Sensor_Library by Seeed

Revision:
2:95009177a860
Parent:
1:e312d147cadd
Child:
3:c25365a52d78
--- a/Air_Quality.h	Thu Dec 22 22:33:19 2016 +0000
+++ b/Air_Quality.h	Fri Dec 23 20:19:35 2016 +0200
@@ -18,15 +18,23 @@
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
-#include"mbed.h"
+#include "mbed.h"
 #include "mbed_debug.h"
 
 #ifndef __AIRQUALITY_H__
 #define __AIRQUALITY_H__
-class AirQuality
-{
+
+enum air_quality_values {
+    UNKNOWN = -1,
+    VERY_HIGH_POLLUTION = 0,
+    HIGH_POLLUTION = 1,
+    LOW_POLLUTION = 2,
+    NO_POLLUTION = 3
+};
+
+class AirQuality {
 public:
-    int i ;
+    int i;
     long vol_standard;
     int init_voltage;
     int first_vol;
@@ -35,10 +43,15 @@
     int counter;
     bool timer_index;
     bool error;
+
     void init(PinName pin, void(*IRQ)(void));
-    int slope(void);
+
+    air_quality_values slope(void);
+
 private:
     PinName _pin;
+
     void avgVoltage(void);
 };
+
 #endif