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

ADC pin cannot be set when creating a MQUnifiedsensor object using the short constructor #63

Closed adrcunha closed 1 year ago

adrcunha commented 1 year ago

Describe the bug

ADC pin cannot be set when creating a MQUnifiedsensor object using the short constructor (name/type only).

To Reproduce

Steps to reproduce the behavior:

  1. Open any example of the library in the Arduino IDE using an Arduino Nano.
  2. Change the MQUnifiedsensor object constructor to use the short constructor (name/type only).
  3. Run the example.
  4. Erratic behavior will happen, as the ADC pin is either incorrect or non-existing.

Expected behavior

Library should be usable with the short constructor (name/type only), allowing further definition of the ADC pin.

Desktop:

OS: macOS 12.3.1 with Arduino IDE 1.8.19 and latest MQSensorsLib