Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info Request regarding an ERROR #2

Open
AnjanaEmani opened this issue May 13, 2021 · 1 comment
Open

Info Request regarding an ERROR #2

AnjanaEmani opened this issue May 13, 2021 · 1 comment

Comments

@AnjanaEmani
Copy link

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.

@rjdainty1
Copy link

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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants