mirror of
https://github.com/miguel5612/MQSensorsLib.git
synced 2025-07-25 21:51:04 +03:00
Added MQ135-ADS1115 example and feature
This commit is contained in:
@ -9,6 +9,10 @@ MQUnifiedsensor::MQUnifiedsensor(String Placa, float Voltage_Resolution, int ADC
|
||||
this-> _VOLT_RESOLUTION = Voltage_Resolution;
|
||||
this-> _ADC_Bit_Resolution = ADC_Bit_Resolution;
|
||||
}
|
||||
MQUnifiedsensor::MQUnifiedsensor(String Placa, String type) {
|
||||
Placa.toCharArray(this->_placa, 20);
|
||||
type.toCharArray(this->_type, 6);
|
||||
}
|
||||
void MQUnifiedsensor::init()
|
||||
{
|
||||
pinMode(_pin, INPUT);
|
||||
@ -108,6 +112,10 @@ void MQUnifiedsensor::update()
|
||||
{
|
||||
_sensor_volt = this->getVoltage();
|
||||
}
|
||||
void MQUnifiedsensor::externalADCUpdate(float volt)
|
||||
{
|
||||
_sensor_volt = volt;
|
||||
}
|
||||
float MQUnifiedsensor::validateEcuation(float ratioInput)
|
||||
{
|
||||
//Serial.print("Ratio input: "); Serial.println(ratioInput);
|
||||
|
@ -14,10 +14,12 @@ class MQUnifiedsensor
|
||||
{
|
||||
public:
|
||||
MQUnifiedsensor(String Placa = "Arduino", float Voltage_Resolution = 5, int ADC_Bit_Resolution = 10, int pin = 1, String type = "CUSTOM MQ");
|
||||
MQUnifiedsensor(String Placa = "Arduino", String type = "CUSTOM MQ");
|
||||
|
||||
//Functions to set values
|
||||
void init();
|
||||
void update();
|
||||
void externalADCUpdate(float volt);
|
||||
void setR0(float R0 = 10);
|
||||
void setRL(float RL = 10);
|
||||
void setA(float a);
|
||||
|
Reference in New Issue
Block a user