Fixed voltage calculation

This commit is contained in:
miguel5612 2020-03-26 11:08:53 -05:00
parent 12695e75a6
commit abac48da38
2 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ void MQUnifiedsensor::serialDebug(bool onSetup)
{
if(!_firstFlag)
{
Serial.println("| ****************************************************************" + _type + "****************************************************************|");
Serial.println("| ********************************************************************" + _type + "*********************************************************************|");
Serial.println("|ADC_In | Equation_V_ADC | Voltage_ADC | Equation_R | Resistance_RS | EQ_Ratio | Ratio (RS/R0) | Equation_PPM | PPM |");
_firstFlag = true; //Headers are printed
}

View File

@ -42,10 +42,10 @@ class MQUnifiedsensor
byte _pin;
byte _firstFlag = false;
byte _VOLT_RESOLUTION = 5.0; // if 3.3v use 3.3
byte _ratioInCleanAir, _sensor_volt;
byte _ratioInCleanAir;
byte _RL = 10; //Value in KiloOhms
double _adc, _a, _b;
double _adc, _a, _b, _sensor_volt;
float _R0, RS_air, _ratio, _PPM, _RS_Calc;
String _type;