Skip to content

Commit

Permalink
DHT sensor more reliable with shorter reset pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
vickash committed Oct 27, 2024
1 parent 326b014 commit aae2005
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/denko/sensor/dht.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def reading
end

def _read
board.pulse_read(pin, reset: board.low, reset_time: 20000, pulse_limit: 84, timeout: 100)
board.pulse_read(pin, reset: board.low, reset_time: 10_000, pulse_limit: 84, timeout: 100)
end

def pre_callback_filter(data)
Expand Down
2 changes: 1 addition & 1 deletion test/sensor/dht_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def part
# It should tell the board to do a #pulse_read
def test__read
part
mock = Minitest::Mock.new.expect(:call, nil, [PIN], reset: board.low, reset_time: 20000, pulse_limit: 84, timeout: 100)
mock = Minitest::Mock.new.expect(:call, nil, [PIN], reset: board.low, reset_time: 10_000, pulse_limit: 84, timeout: 100)
board.stub(:pulse_read, mock) do
part._read
end
Expand Down

0 comments on commit aae2005

Please sign in to comment.