summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-06-26 17:48:05 +1000
committerDamien George <damien.p.george@gmail.com>2017-06-26 17:48:05 +1000
commit683df1c8d5ab37dbb0d2909bcd94c7e4eea3232f (patch)
treea2330a756981095d9263c620857e90b1253ea2ef
parent118173013f41a4f661bdb9baa88fb147e346ce75 (diff)
downloadmicropython-683df1c8d5ab37dbb0d2909bcd94c7e4eea3232f.tar.gz
micropython-683df1c8d5ab37dbb0d2909bcd94c7e4eea3232f.zip
drivers/onewire: Enable pull-up when init'ing the 1-wire pin.
A previous version of the 1-wire driver (which was recently replaced by the current one) had this behaviour and it allows to create a 1-wire bus without any external pull-up resistors.
-rw-r--r--drivers/onewire/onewire.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/onewire/onewire.py b/drivers/onewire/onewire.py
index 546a69b304..3309ba0d27 100644
--- a/drivers/onewire/onewire.py
+++ b/drivers/onewire/onewire.py
@@ -14,7 +14,7 @@ class OneWire:
def __init__(self, pin):
self.pin = pin
- self.pin.init(pin.OPEN_DRAIN)
+ self.pin.init(pin.OPEN_DRAIN, pin.PULL_UP)
def reset(self, required=False):
reset = _ow.reset(self.pin)