71 MQ7(
const unsigned int& digitalOutputPinNumber);
142 std::string
ToString()
const override;
Base class for the MQ-series gas sensors (MQ2, MQ7, ...).
Definition: GasSensor.h:19
Interface for analog-to-digital converter components (e.g.
Definition: AnalogDigitalConverterComponent.h:14
MQ-7 gas sensor, typically used for detecting carbon monoxide.
Definition: MQ7.h:14
void Initialize() override
Initializes the MQ-7's datasheet values (its carbon monoxide gas curve) and precomputes a PPM value f...
Definition: MQ7.cpp:101
MQ7()
Builds a default MQ-7 (carbon monoxide) sensor and initializes its datasheet values.
Definition: MQ7.cpp:15
double ReadGasValue() const override
Reads the current carbon monoxide PPM for the sensor's raw reading (from the precomputed cache).
Definition: MQ7.cpp:129
std::string ToString() const override
Serializes the MQ-7's gas name, raw reading, and carbon monoxide PPM to a string.
Definition: MQ7.cpp:168
double CalculateCarbonMonoxidePPM(const double &sensorGasValueInVolts) const
Computes the carbon monoxide concentration (PPM) from the sensor's output voltage using an exponentia...
Definition: MQ7.cpp:149
virtual ~MQ7()
Destroys the sensor, turning it off first.
Definition: MQ7.cpp:85
RumPi is the library's top-level facade.
Definition: AlertManager.h:6