I am using normal power (not sacrificial) and using 3V3 and have tried GPIO.0 and GPIO.4, the ESP32 appears to be getting a recognisable return but is unable to identify the 18S20.
Before I start hooking up my scope and analyse the signals, has anyone else RECENTLY succeeded in reading the 18S20 on the ESP32 device using the built in libraries ??
Code: Select all
import time
import machine
import onewire, ds18x20
dat = machine.Pin(4)
# create the onewire object
ds = ds18x20.DS18X20(onewire.OneWire(dat))
# scan for devices on the bus
roms = ds.scan()
print('found devices:', roms)
# loop 10 times and print all temperatures
for i in range(10):
print('temperatures:', end=' ')
ds.convert_temp()
time.sleep_ms(750)
for rom in roms:
print(ds.read_temp(rom), end=' ')
print()
Code: Select all
>>> from test import ds18x20
found devices: []
temperatures:
temperatures:
temperatures:
temperatures:
temperatures:
temperatures:
temperatures:
temperatures:
temperatures:
temperatures: