mirror of
https://github.com/miguel5612/MQSensorsLib.git
synced 2025-07-25 21:51:04 +03:00
Added Linear ecuation on test algorithm
This commit is contained in:
@ -112,9 +112,9 @@ float MQUnifiedsensor::validateEcuation(float ratioInput)
|
||||
if(_regressionMethod == 1) _PPM= _a*pow(ratioInput, _b);
|
||||
else
|
||||
{
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor
|
||||
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
|
||||
// https://jayconsystems.com/blog/understanding-a-gas-sensor
|
||||
double ppm_log = (log10(ratioInput)-_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
|
||||
}
|
||||
//Serial.println("Regression Method: "); Serial.println(_regressionMethod);
|
||||
//Serial.println("Result: "); Serial.println(_PPM);
|
||||
|
Reference in New Issue
Block a user