Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Problems with Pin class

    Scheduled Pinned Locked Moved WiPy 2&3
    3 Posts 2 Posters 1.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      alfheim
      last edited by

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

      This 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

      1 Reply Last reply Reply Quote 0
      • X Offline
        Xykon administrators
        last edited by

        The possibility to use alternate functions for Pins has not been implemented yet.

        You could try without the alt=-1 part.

        Christian Ehlers

        1 Reply Last reply Reply Quote 0
        • X Offline
          Xykon administrators
          last edited by

          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.

          Christian Ehlers

          1 Reply Last reply Reply Quote 0

          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
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom