Onewire library function does not work
-
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()) -
@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 ....
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