Skip to content

Commit 91f6e8c

Browse files
authored
Merge pull request #47 from michaellass/start_paused
Immediately pause pulse_in after initialization
2 parents a67ac23 + 847ce95 commit 91f6e8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_dht.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def __init__(self, dht11, pin, trig_wait, use_pulseio):
7272
# and we're better off having a running process
7373
if self._use_pulseio:
7474
self.pulse_in = PulseIn(self._pin, 81, True)
75+
self.pulse_in.pause()
7576

7677
def exit(self):
7778
""" Cleans up the PulseIn process. Must be called explicitly """
@@ -125,7 +126,6 @@ def _get_pulses_pulseio(self):
125126
# specific length of time. Then the device sends back a
126127
# series HIGH and LOW signals. The length the HIGH signals
127128
# represents the device values.
128-
self.pulse_in.pause()
129129
self.pulse_in.clear()
130130
self.pulse_in.resume(self._trig_wait)
131131

0 commit comments

Comments
 (0)