#include <MQ-Sensor-SOLDERED.h>
Inherits MQUnifiedsensor.
Inherited by MQ131, MQ135, MQ136, MQ137, MQ138, MQ2, MQ214, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, and MQ9.
|
| | MQ_Sensor (int _aPin, int _dPin, String type, sensorType sType) |
| |
| void | begin () |
| | Initializes the sensor with default configuration. Sets pin modes for analog and digital pins if they are defined.
|
| |
| void | begin (sensorType configcustom) |
| | Initializes the sensor with custom configuration. Sets pin modes for analog and digital pins if they are defined.
|
| |
| bool | begin (int _addr) |
| | Initializes the sensor with a specific I2C address. Overloaded function for virtual in base class to initialize sensor specific.
|
| |
| bool | begin (int _addr, sensorType configcustom) |
| | Initializes the sensor with a specific I2C address and custom configuration. Overloaded function for virtual in base class to initialize sensor specific.
|
| |
| void | setRegressionModel (const sensorType &type) |
| | Sets the regression model parameters for the sensor based on given type.
|
| |
| bool | calibrateSensor (int numOfCalibrations) |
| | Calibrates the sensor by taking multiple readings and averaging them.
|
| |
| bool | digitalRead () |
| | Reads the digital pin state of the sensor. Overloaded function for virtual in base class to initialize sensor specific.
|
| |
| | MQUnifiedsensor (int pin=1, String Placa="Arduino", float Voltage_Resolution=5, int ADC_Bit_Resolution=10, String type="CUSTOM MQ") |
| |
| void | init (int addr) |
| |
| void | update () |
| |
| void | setR0 (float R0=10) |
| |
| void | setRL (float RL=10) |
| |
| void | setA (float a) |
| |
| void | setB (float b) |
| |
| void | setRegressionMethod (int regressionMethod) |
| |
| void | setVoltResolution (float voltage_resolution=5) |
| |
| void | serialDebug (bool onSetup=false) |
| |
| void | setADC (int value) |
| |
| float | calibrate (float ratioInCleanAir) |
| |
| float | readSensor () |
| |
| float | validateEcuation (float ratioInput=0) |
| |
| float | getA () |
| |
| float | getB () |
| |
| float | getR0 () |
| |
| float | getRL () |
| |
| float | getVoltResolution () |
| |
| String | getRegressionMethod () |
| |
| float | getVoltage (int read=true) |
| |
| float | stringTofloat (String &str) |
| |
◆ MQ_Sensor()
| MQ_Sensor::MQ_Sensor |
( |
int | _aPin, |
|
|
int | _dPin, |
|
|
String | type, |
|
|
sensorType | sType ) |
|
inline |
◆ begin() [1/4]
| void MQ_Sensor::begin |
( |
| ) |
|
Initializes the sensor with default configuration. Sets pin modes for analog and digital pins if they are defined.
◆ begin() [2/4]
| bool MQ_Sensor::begin |
( |
int | _addr | ) |
|
Initializes the sensor with a specific I2C address. Overloaded function for virtual in base class to initialize sensor specific.
- Parameters
-
| _addr | I2C address of the sensor |
- Returns
- bool True if initialization successful, false if I2C communication fails
◆ begin() [3/4]
| bool MQ_Sensor::begin |
( |
int | _addr, |
|
|
sensorType | configcustom ) |
Initializes the sensor with a specific I2C address and custom configuration. Overloaded function for virtual in base class to initialize sensor specific.
- Parameters
-
| _addr | I2C address of the sensor |
| configcustom | Custom sensor configuration of type sensorType |
- Returns
- bool True if initialization successful, false if I2C communication fails
◆ begin() [4/4]
Initializes the sensor with custom configuration. Sets pin modes for analog and digital pins if they are defined.
- Parameters
-
| configcustom | Custom sensor configuration of type sensorType |
◆ calibrateSensor()
| bool MQ_Sensor::calibrateSensor |
( |
int | numOfCalibrations | ) |
|
Calibrates the sensor by taking multiple readings and averaging them.
- Parameters
-
| numOfCalibrations | Number of calibration readings to take |
- Returns
- bool True if calibration successful, false if calculated R0 is invalid
◆ digitalRead()
| bool MQ_Sensor::digitalRead |
( |
| ) |
|
Reads the digital pin state of the sensor. Overloaded function for virtual in base class to initialize sensor specific.
- Returns
- bool True if sensor is triggered, false otherwise
◆ setConfiguration()
| void MQ_Sensor::setConfiguration |
( |
sensorType & | type | ) |
|
|
private |
Configures the sensor with the given sensor type parameters.
- Parameters
-
| type | Sensor type configuration containing all necessary parameters |
◆ setRegressionModel()
| void MQ_Sensor::setRegressionModel |
( |
const sensorType & | type | ) |
|
Sets the regression model parameters for the sensor based on given type.
- Parameters
-
| type | Sensor type configuration containing regression method and coefficients |
◆ aPin
◆ dPin
◆ sensor_type
The documentation for this class was generated from the following files: