miguel5612 / MQSensorsLib

We present a unified library for MQ sensors, this library allows to read MQ signals easily from Arduino, Genuino, ESP8266, ESP-32 boards whose references are MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, MQ131, MQ135, MQ136, MQ303A, MQ309A.
MIT License
169 stars 64 forks source link

Allow setting the ADC pin of a MQUnifiedsensor object. #64

Closed adrcunha closed 1 year ago

adrcunha commented 1 year ago

Description

The ADC pin can only be set when using the full/long constructor, causing the short constructor (name/type only) useless because the pin is unset.

Also default the ADC pin to 1 for consistency sake.

Fixes #63.

Type of change

How Has This Been Tested?

Successfully ran the MQ-135 example with the following changes:

Tests performed on Arduino IDE 1.8.19 with Arduino Nano and a MQ135 sensor.