Skip to content

Commit c1276db

Browse files
committed
Update dht_time_calibration.py
Add more description and also what parameters were used on the test.
1 parent 378d6c2 commit c1276db

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

examples/dht_time_calibration.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,30 @@
1212

1313
# Maximum number of tries per timing
1414
max_retries_per_time = 10
15-
# Minimum time from where to start testing
16-
min_time = 500
17-
# Maximum time on where to stop testing
15+
# Minimum wait time from where to start testing
16+
min_time = 1500
17+
# Maximum wait time on where to stop testing
1818
max_time = 2000
1919
# Increment on time
2020
time_increment = 100
2121

2222
# Variable to store all reads on a try
2323
reads = {}
2424

25-
print("\nInitializing test.\n", f"Total tries per trig_wait {max_retries_per_time}")
25+
initial_msg = f"""
26+
\nInitializing test with the following parameters:
27+
28+
- Maximum retries per waiting time: {max_retries_per_time}
29+
- Start time (ms): {min_time}
30+
- End time (ms): {max_time}
31+
- Increment time (ms): {time_increment}
32+
33+
This execution will try to read the sensor {max_retries_per_time} times
34+
for {len(range(min_time, max_time, time_increment))} different wait times values.
35+
36+
"""
37+
# Print initial message on the console.
38+
print(initial_msg)
2639

2740
for milliseconds in range(min_time, max_time, time_increment):
2841
# Instantiate the DHT11 object.

0 commit comments

Comments
 (0)