Problems with Pin class
-
Hi.
I'm trying to modify the DHT22 class (https://github.com/kurik/uPython-DHT22) to work on WiPy2
No matter what I try to put in line 37:
nc = Pin(nc_pin, mode=Pin.OPEN_DRAIN, pull=None, alt=-1)The result is always:
Traceback (most recent call last):
File "<stdin>", line 13, in <module>
File "/flash/lib/dht/DHT22.py", line 37, in init
ValueError: invalid argument(s) valueThis is my code to use the class:
from dht import DHT22
DHT22.init(nc_pin=5, gnd_pin = 'GND', vcc_pin='3V3 OUT', data_pin=6)Another question: the original DHT22 class want to know the GND and 3V3 pin: how are they mapped in machine library?
Thanks
-
The possibility to use alternate functions for Pins has not been implemented yet.
You could try without the alt=-1 part.
-
I've had a look at the code... Timers are not yet implemented so this code will not yet work. Also your init should use correct pin names, example: 'P5', 'P6' etc.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login