Grove Air Quality Sensor library. Simple interrupt driven library that polls the sensor every 2 seconds and reports on the air quality.

Fork of Grove_Air_Quality_Sensor_Library by Austin Blackstone

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Air_Quality.h Source File

Air_Quality.h

00001 /*
00002   AirQuality library v1.0
00003   2010 Copyright (c) Seeed Technology Inc.  All right reserved.
00004 
00005   Original Author: Bruce.Qin
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Lesser General Public
00009   License as published by the Free Software Foundation; either
00010   version 2.1 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Lesser General Public License for more details.
00016 
00017   You should have received a copy of the GNU Lesser General Public
00018   License along with this library; if not, write to the Free Software
00019   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 */
00021 #include"mbed.h"
00022 #ifndef __AIRQUALITY_H__
00023 #define __AIRQUALITY_H__
00024 class AirQuality
00025 {
00026 public:
00027     int i ;
00028     long vol_standard;
00029     int init_voltage;
00030     int first_vol;
00031     int last_vol;
00032     int temp;
00033     int counter;
00034     bool timer_index;
00035     bool error;
00036     void init(PinName pin, void(*IRQ)(void));
00037     int slope(void);
00038 private:
00039     PinName _pin;
00040     void avgVoltage(void);
00041 };
00042 #endif