float SCKAmbient::readMICS(byte device)
 {
     float Rs = readRs(device);
     float RL = readRL(device); //Ohm
     
     // Charging impedance correction
     if ((Rs <= (RL - 1000))||(Rs >= (RL + 1000)))
     {
       if (Rs < 2000) writeRL(device, 2000);
       else writeRL(device, Rs);
       delay(100);
       Rs = readRs(device);
     }
      return Rs;
 }
Beispiel #2
0
float BaseMQ::readRatio() const {
  return readRs() / getRo();
}
Beispiel #3
0
// калибровка датчика
// считывания показаний сопративление датчика на чистом воздухе
// далее фиксированая калибровка датчика
void BaseMQ::calibrate() {
  float rs = readRs();
  float ro = rs / getRoInCleanAir();
  calibrate(ro);
}
Beispiel #4
0
float MQ3::readMgL(float a, float b) {
  float ratio = readRs()/_ro;
  return pow(M_E, (log(ratio)-b)/a);
}