Extend API for optional correction factor

This commit is contained in:
Miguel Angel Califa Urquiza
2025-06-04 19:29:44 -05:00
parent 6f9b00666e
commit 30c0979cb4
30 changed files with 90 additions and 60 deletions

View File

@ -81,7 +81,8 @@ void loop() {
//https://jayconsystems.com/blog/understanding-a-gas-sensor
MQ4.setA(-0.318); MQ4.setB(1.133); // A -> Slope, B -> Intersect with X - Axis
float LPG = MQ4.readSensor(); // Sensor will read PPM concentration using the model, a and b values set previously or from the setup
float correctionFactor = 0; // Optional environmental correction
float LPG = MQ4.readSensor(false, correctionFactor); // Sensor will read PPM concentration using the model, a and b values set previously or from the setup
// exposure to 2000 ppm of LPG gas is immediately dangerous to life and health. In this section
if(LPG>=2000) Serial.println("Warning - Very high concentrations detected!");