Skip to content

Immediately pause pulse_in after initialization #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adafruit_dht.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, dht11, pin, trig_wait):
# and we're better off having a running process
if _USE_PULSEIO:
self.pulse_in = PulseIn(self._pin, 81, True)
self.pulse_in.pause()

def _pulses_to_binary(self, pulses, start, stop):
"""Takes pulses, a list of transition times, and converts
Expand Down Expand Up @@ -114,7 +115,6 @@ def _get_pulses_pulseio(self):
# specific length of time. Then the device sends back a
# series HIGH and LOW signals. The length the HIGH signals
# represents the device values.
self.pulse_in.pause()
self.pulse_in.clear()
self.pulse_in.resume(self._trig_wait)

Expand Down