Skip to content

Commit 7f11a00

Browse files
committed
Fix duty cycle measurement (was reversed)
1 parent 817ec46 commit 7f11a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PSL/logic_analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def measure_duty_cycle(self, channel: str, timeout: float = 1) -> Tuple[float]:
231231

232232
period = t[2] - t[0]
233233
# First change is HIGH -> LOW since we trigger on rising.
234-
duty_cycle = (t[1] - t[0]) / period
234+
duty_cycle = 1 - (t[1] - t[0]) / period
235235

236236
return period, duty_cycle
237237

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy