File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ bundles
1313.eggs
1414dist
1515** /* .egg-info
16+ venv
Original file line number Diff line number Diff line change @@ -6,3 +6,13 @@ Ensure your device works with this simple test.
66.. literalinclude :: ../examples/dht_simpletest.py
77 :caption: examples/dht_simpletest.py
88 :linenos:
9+
10+
11+ Time calibration advance test
12+ ------------
13+
14+ Check what is the best time your sensor.
15+
16+ .. literalinclude :: ../examples/dht_time_calibration_advance.py
17+ :caption: examples/dht_time_calibration_advance.py
18+ :linenos:
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: 2021 yeyeto2788 for Adafruit Industries
22# SPDX-License-Identifier: MIT
33
4+ """
5+ This script let's you check the best timing for you sensor as other people have face timing issues
6+ as seen on issue https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/66.
7+
8+ By changing the variables values below you will be able to check the best timing for you sensor,
9+ take into account that by most datasheets the timing for the sensor are 0.001 DHT22 and
10+ 0.018 for DHT11 which are the default values of the library.
11+ """
12+
413import json
514import time
615
716import board
817
918import adafruit_dht
1019
20+ # Change the pin used below
1121pin_to_use = "PG6"
1222
1323# Maximum number of tries per timing
4151 # Instantiate the DHT11 object.
4252 dhtDevice = adafruit_dht .DHT11 (pin = getattr (board , pin_to_use ))
4353 # Change the default wait time for triggering the read.
44- # pylint: disable=W0212
54+ # pylint: disable=protected-access
4555 dhtDevice ._trig_wait = milliseconds
4656
47- # pylint: disable=W0212
57+ # pylint: disable=protected-access
4858 print (f"Using 'trig_wait' of { dhtDevice ._trig_wait } " )
4959 # Reset the read count for next loop
5060 reads_count = 0
You can’t perform that action at this time.
0 commit comments