This sensor is designed for comprehensive monitor over indoor air condition. It's responsive to a wide scope of harmful gases, as carbon monixide, alcohol, acetone, thinner, formaldehyde and so on. Due to the measuring mechanism, this sensor can not output specific data to describe target gases' concentrations quantitatively. But it's still competent enough to be used in applications that require only qualitative results, like auto refresher sprayers and auto air cycling systems.
Dependencies: Grove_Air_Quality_Sensor_Library mbed
Fork of Seeed_Grove_Air_Quality_Sensor_Example by
main.cpp@0:2dbce8e35862, 2014-09-05 (annotated)
- Committer:
- mbedAustin
- Date:
- Fri Sep 05 03:39:31 2014 +0000
- Revision:
- 0:2dbce8e35862
- Child:
- 1:888328032581
Grove Air Quality sensor example application. Test the air quality every 5 seconds and report. Score quality from 0-100 like the daily weather report.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedAustin | 0:2dbce8e35862 | 1 | #include "mbed.h" |
mbedAustin | 0:2dbce8e35862 | 2 | |
mbedAustin | 0:2dbce8e35862 | 3 | AnalogIn sensor(A0); |
mbedAustin | 0:2dbce8e35862 | 4 | |
mbedAustin | 0:2dbce8e35862 | 5 | int main() { |
mbedAustin | 0:2dbce8e35862 | 6 | float sensorValue; |
mbedAustin | 0:2dbce8e35862 | 7 | while (true) { |
mbedAustin | 0:2dbce8e35862 | 8 | sensorValue = sensor.read(); |
mbedAustin | 0:2dbce8e35862 | 9 | printf("\r Air Quality score = %3.2f",100 - (sensorValue*100)); |
mbedAustin | 0:2dbce8e35862 | 10 | wait(5); |
mbedAustin | 0:2dbce8e35862 | 11 | } |
mbedAustin | 0:2dbce8e35862 | 12 | } |