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

    Onewire library function does not work

    Scheduled Pinned Locked Moved Pymakr
    onewireds18b20sensor
    2 Posts 2 Posters 543 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.
    • B Offline
      brossingo
      last edited by

      Hi everyone! I am trying to read temperature values using a DS18x20 sensor and a 1-Wire. Thus I use both libraries which you can find here : https://github.com/pycom/pycom-libraries/blob/master/examples/DS18X20/onewire.py. However, the read_temp_async function keeps returning None as a result. Following the indication on the link, it says that this is due to the fact that the convertion is not completed but still, I do not understand why this is happening. I do not know if this is due to the code (which you can find down there and is very simple) or to the electronic circuit I made (which includes a Pycom device connected to the computer through a USB cable and this device is also connected to a breadboard containing the sensor). Thanks for helping

      ow=OneWire(Pin('G5'))
      r=DS18x20(ow)
      print(r.read_temp_async())

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @brossingo
        last edited by

        @brossingo G5 is an input only pin, like G4, G0, G3, G31 and G30. Try another pin, like G22 or G17 or G7 or G6 or ....

        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