A library for the MQ2 sensor. Based on https://github.com/labay11 and http://sandboxelectronics.com/?p=165
Dependents: mq2_example mq2_midtermproject ECE595_Group9_FinalProject mq2_example ... more
Diff: MQ2.cpp
- Revision:
- 4:48545e508081
- Parent:
- 3:ed294e830904
- Child:
- 5:8b7ba76a7a76
diff -r ed294e830904 -r 48545e508081 MQ2.cpp --- a/MQ2.cpp Fri Oct 06 07:51:13 2017 +0000 +++ b/MQ2.cpp Fri Oct 06 08:34:50 2017 +0000 @@ -19,21 +19,21 @@ * reads data, returns LPG value in ppm */ float MQ2::readLPG(){ - return MQGetGasPercentage(MQRead()/10,GAS_LPG); + return MQGetGasPercentage(MQRead()/Ro,GAS_LPG); } /* * reads data, returns CO value in ppm */ float MQ2::readCO(){ - return MQGetGasPercentage(MQRead()/10,GAS_CO); + return MQGetGasPercentage(MQRead()/Ro,GAS_CO); } /* * reads data, returns Smoke value in ppm */ float MQ2::readSmoke(){ - return MQGetGasPercentage(MQRead()/10,GAS_SMOKE); + return MQGetGasPercentage(MQRead()/Ro,GAS_SMOKE); } /****************** MQResistanceCalculation ****************************************