How to call a value from sketch to library?

Hello guys, I’m currently working on a project were i use a MQ135 sensor. To calibrate the sensor correctly I use a small library. In the library there is the following Variable: #define RZERO 1406.31
1406.31 is a value I have measured, and updating the RZERO to that measured value is a part of the calibration process. However I have three sensors, which all takes different values. So when i change the RZERO in the library, it will be the same value for all three sensors.
I wonder if somehow can arrange the #define RZERO value, to be in my sketch, and let the calculations in library use the RZERO from my sketch code instead.

If i have tried to simple cut the #define RZERO 1406.31 from the library, and into the sketch without luck.
Does anyone know how to fix this? Here is my code:

Library:

#ifndef MQ135_H
#define MQ135_H
#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

/// The load resistance on the board
#define RLOAD 10.0
#define RZERO 1406.31

/// Parameters for calculating ppm of CO2 from sensor resistance
#define PARA 116.6020682
#define PARB 2.769034857

/// Parameters to model temperature and humidity dependence
#define CORA 0.00035
#define CORB 0.02718
#define CORC 1.39538
#define CORD 0.0018

/// Atmospheric CO2 level for calibration purposes
#define ATMOCO2 397.13

class MQ135 {
 private:
  uint8_t _pin;

 public:
  MQ135(uint8_t pin);
  float getCorrectionFactor(float t, float h);
  float getResistance();
  float getCorrectedResistance(float t, float h);
  float getPPM();
  float getCorrectedPPM(float t, float h);
  float getRZero();
  float getCorrectedRZero(float t, float h);
};
#endif

Sketch code:

#include <MQ135.h>

int ANALOGPIN = A0;  
MQ135 gasSensor = MQ135(ANALOGPIN); 

float ppm; 
unsigned long  previousMillis = 0; 
const long interval = 200; 
 
void setup(){
  Serial.begin(9600); 
  
   Serial.print("Calibrating ");
  for(int i = 0; i < 40; i++){
    Serial.print(".");
    delay(1000); 
  }   
}

void loop(){
  unsigned long  currentMillis = millis(); 

  
  if(currentMillis - previousMillis > interval){
    previousMillis = currentMillis;
    
    ppm = gasSensor.getPPM(); 
  Serial.println(ppm, DEC); 
  }
  delay(10); 
}

you can probably pass the calibration as a constant in either the constructor or in a begin() function.

Each instance of the class could have its own calibration factor.

Can you post the .cpp implementation file of your library?

here is the .cpp file

#include "MQ135.h"

/**************************************************************************/
/*!
@brief  Default constructor

@param[in] pin  The analog input pin for the readout of the sensor
*/
/**************************************************************************/

MQ135::MQ135(uint8_t pin) {
  _pin = pin;
}


/**************************************************************************/
/*!
@brief  Get the correction factor to correct for temperature and humidity

@param[in] t  The ambient air temperature
@param[in] h  The relative humidity

@return The calculated correction factor
*/
/**************************************************************************/
float MQ135::getCorrectionFactor(float t, float h) {
  return CORA * t * t - CORB * t + CORC - (h-33.)*CORD;
}

/**************************************************************************/
/*!
@brief  Get the resistance of the sensor, ie. the measurement value

@return The sensor resistance in kOhm
*/
/**************************************************************************/
float MQ135::getResistance() {
  int val = analogRead(_pin);
  return ((1023./(float)val) * 5. - 1.)*RLOAD;
}

/**************************************************************************/
/*!
@brief  Get the resistance of the sensor, ie. the measurement value corrected
        for temp/hum

@param[in] t  The ambient air temperature
@param[in] h  The relative humidity

@return The corrected sensor resistance kOhm
*/
/**************************************************************************/
float MQ135::getCorrectedResistance(float t, float h) {
  return getResistance()/getCorrectionFactor(t, h);
}

/**************************************************************************/
/*!
@brief  Get the ppm of CO2 sensed (assuming only CO2 in the air)

@return The ppm of CO2 in the air
*/
/**************************************************************************/
float MQ135::getPPM() {
  return PARA * pow((getResistance()/RZERO), -PARB);
}

/**************************************************************************/
/*!
@brief  Get the ppm of CO2 sensed (assuming only CO2 in the air), corrected
        for temp/hum

@param[in] t  The ambient air temperature
@param[in] h  The relative humidity

@return The ppm of CO2 in the air
*/
/**************************************************************************/
float MQ135::getCorrectedPPM(float t, float h) {
  return PARA * pow((getCorrectedResistance(t, h)/RZERO), -PARB);
}

/**************************************************************************/
/*!
@brief  Get the resistance RZero of the sensor for calibration purposes

@return The sensor resistance RZero in kOhm
*/
/**************************************************************************/
float MQ135::getRZero() {
  return getResistance() * pow((ATMOCO2/PARA), (1./PARB));
}

/**************************************************************************/
/*!
@brief  Get the corrected resistance RZero of the sensor for calibration
        purposes

@param[in] t  The ambient air temperature
@param[in] h  The relative humidity

@return The corrected sensor resistance RZero in kOhm
*/
/**************************************************************************/
float MQ135::getCorrectedRZero(float t, float h) {
  return getCorrectedResistance(t, h) * pow((ATMOCO2/PARA), (1./PARB));
}