Page 1 of 1

Sparkfun ESP32 Thing with DS18b20 not working

Posted: Wed Jan 30, 2019 4:41 am
by kenglover
Hello everyone,
Thanks for the great work on MicroPython.

I am trying to get temperature readings working using a ds18b20 using a Sparkfun ESP32 Thing board. It was working when using Arduino, but when I change over to MicroPythod it always returns 85 (indicates error).

I am using the most recent release v1.10 and have even tried building it myself from source.

My code is:
import time
import machine, onewire
import ds18x20

# the device is on GPIO19
dat = machine.Pin(19)

# create the onewire object
ds = ds18x20.DS18X20(onewire.OneWire(dat))

# scan for devices on the bus
roms = ds.scan()
print('found devices:', roms)