AtomVM icon indicating copy to clipboard operation
AtomVM copied to clipboard

1-wire support

Open kwando opened this issue 10 months ago • 1 comments

Some sensors use the 1-wire protocol, for instance the common temperature sensor ds18b20. Would be great to have a driver for this. https://en.wikipedia.org/wiki/1-Wire

Do you think an esp32 would be fast enough to do this via the gpio module?

kwando avatar Feb 15 '25 18:02 kwando

From looking at this ESP-IDF based driver implementation, it looks like 1-wire relies on precise microsecond timing that we could not guarantee for bit-banging from the Erlang GPIO driver: https://github.com/UncleRus/esp-idf-lib/tree/master/components/onewire

It does look like a fairly easy driver to port to AtomVM. I don’t know if it is popular enough to include in the default image, but an external driver, (especially one based on the component I linked above) should be fairly easy. I have several things I am working on at the moment, or I would tackle this for you right away.

UncleGrumpy avatar Feb 15 '25 20:02 UncleGrumpy