mirror of
https://github.com/miguel5612/MQSensorsLib.git
synced 2025-07-25 21:51:04 +03:00
Merge pull request #82 from miguel5612/codex/fix-typos-in-repository-files
Fix typos across library
This commit is contained in:
@ -161,16 +161,16 @@ float MQUnifiedsensor::readSensor(bool isMQ303A, float correctionFactor, bool in
|
||||
if(_RS_Calc < 0) _RS_Calc = 0; //No negative values accepted.
|
||||
if(!injected) _ratio = _RS_Calc / this->_R0; // Get ratio RS_gas/RS_air
|
||||
_ratio += correctionFactor;
|
||||
if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recomendation.
|
||||
if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analisis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents
|
||||
if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recommendation.
|
||||
if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analysis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents
|
||||
else
|
||||
{
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear ecuation
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear equation
|
||||
double ppm_log = (log10(_ratio)-_b)/_a; //Get ppm value in linear scale according to the the ratio value
|
||||
_PPM = pow(10, ppm_log); //Convert ppm value to log scale
|
||||
}
|
||||
if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recomendation.
|
||||
//if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recomendation.
|
||||
if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recommendation.
|
||||
//if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recommendation.
|
||||
return _PPM;
|
||||
}
|
||||
float MQUnifiedsensor::readSensorR0Rs()
|
||||
@ -179,16 +179,16 @@ float MQUnifiedsensor::readSensorR0Rs()
|
||||
_RS_Calc = ((_VCC*_RL)/_sensor_volt)-_RL; //Get value of RS in a gas
|
||||
if(_RS_Calc < 0) _RS_Calc = 0; //No negative values accepted.
|
||||
_ratio = this->_R0/_RS_Calc; // Get ratio RS_air/RS_gas <- INVERTED for MQ-131 issue 28 https://github.com/miguel5612/MQSensorsLib/issues/28
|
||||
if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recomendation.
|
||||
if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analisis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents
|
||||
if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recommendation.
|
||||
if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analysis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents
|
||||
else
|
||||
{
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear ecuation
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear equation
|
||||
double ppm_log = (log10(_ratio)-_b)/_a; //Get ppm value in linear scale according to the the ratio value
|
||||
_PPM = pow(10, ppm_log); //Convert ppm value to log scale
|
||||
}
|
||||
if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recomendation.
|
||||
//if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recomendation.
|
||||
if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recommendation.
|
||||
//if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recommendation.
|
||||
return _PPM;
|
||||
}
|
||||
float MQUnifiedsensor::calibrate(float ratioInCleanAir) {
|
||||
|
Reference in New Issue
Block a user