micropython-MQ icon indicating copy to clipboard operation
micropython-MQ copied to clipboard

Info Request regarding an ERROR

Open AnjanaEmani opened this issue 4 years ago • 1 comments

Hi, I am working with ESP32 and MQ2 gas sensor using Micropython. In the main code i.e. test.py , an error regarding pin assignment is thrown and I am unable to fix it. I have tried ways and means for that. But still it persists.

_

Traceback (most recent call last): File "", line 24, in File "", line 9, in init File "MQ2.py", line 13, in init File "BaseMQ.py", line 58, in init ValueError: expecting a pin

_

What could be the probable reason. Could you please help me out with this. Thank you.

AnjanaEmani avatar May 13 '21 16:05 AnjanaEmani

I received the same response, it turns out that the ADB command in BaseMQ.py requires a Pin object rather than a number. So I changed line 57: self.pinData = ADC(pinData)

Became: self.pinData = ADC(Pin(pinData))

rjdainty1 avatar Feb 09 '22 23:02 rjdainty1