micropython-MQ
micropython-MQ copied to clipboard
Info Request regarding an ERROR
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.
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))