We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e7e017 commit 2de02e0Copy full SHA for 2de02e0
examples/ads1x15_fast_read.py
@@ -32,15 +32,15 @@
32
for i in range(SAMPLES):
33
data[i] = chan0.value
34
# Detect repeated values due to over polling
35
- if data[i] == data[i-1]:
+ if data[i] == data[i - 1]:
36
repeats += 1
37
38
39
end = time.monotonic()
40
total_time = end - start
41
42
rate_reported = SAMPLES / total_time
43
-rate_actual = (SAMPLES-repeats) / total_time
+rate_actual = (SAMPLES - repeats) / total_time
44
# NOTE: leave input floating to pickup some random noise, this cannot estimate conversion rates higher than polling rate
45
46
print("Took {:5.3f} s to acquire {:d} samples.".format(total_time, SAMPLES))
0 commit comments