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
13
13
.eggs
14
14
dist
15
15
** /* .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.
6
6
.. literalinclude :: ../examples/dht_simpletest.py
7
7
:caption: examples/dht_simpletest.py
8
8
: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 1
1
# SPDX-FileCopyrightText: 2021 yeyeto2788 for Adafruit Industries
2
2
# SPDX-License-Identifier: MIT
3
3
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
+
4
13
import json
5
14
import time
6
15
7
16
import board
8
17
9
18
import adafruit_dht
10
19
20
+ # Change the pin used below
11
21
pin_to_use = "PG6"
12
22
13
23
# Maximum number of tries per timing
41
51
# Instantiate the DHT11 object.
42
52
dhtDevice = adafruit_dht .DHT11 (pin = getattr (board , pin_to_use ))
43
53
# Change the default wait time for triggering the read.
44
- # pylint: disable=W0212
54
+ # pylint: disable=protected-access
45
55
dhtDevice ._trig_wait = milliseconds
46
56
47
- # pylint: disable=W0212
57
+ # pylint: disable=protected-access
48
58
print (f"Using 'trig_wait' of { dhtDevice ._trig_wait } " )
49
59
# Reset the read count for next loop
50
60
reads_count = 0
You can’t perform that action at this time.
0 commit comments