diff options
Diffstat (limited to 'prototype/fw')
-rw-r--r-- | prototype/fw/freqmeter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/prototype/fw/freqmeter.py b/prototype/fw/freqmeter.py index 54c1655..430b73f 100644 --- a/prototype/fw/freqmeter.py +++ b/prototype/fw/freqmeter.py @@ -12,11 +12,11 @@ count = lambda le_iter: sum(1 for _ in le_iter) DEFAULT_SAMPLING_RATE = 1e6 # sps -def sigrok_capture(duration:'seconds'=1, sampling_rate=DEFAULT_SAMPLING_RATE, driver='dreamsourcelab-dslogic', config=None, channel=0): +def sigrok_capture(duration:'milliseconds', sampling_rate=DEFAULT_SAMPLING_RATE, driver='dreamsourcelab-dslogic', config=None, channel=0): proc = subprocess.run(['sigrok-cli', '--driver', driver, - '--time', f'{duration}s', + '--time', f'{duration}ms', '--config', (f'{config},' if config else '') + f'samplerate={int(sampling_rate/1e3)}k', '--channels', str(channel), '--output-format', 'csv'], check=True, stdout=subprocess.PIPE) @@ -54,7 +54,7 @@ def calc_frequency(intervals, sampling_rate=DEFAULT_SAMPLING_RATE): if __name__ == '__main__': while True: - capture = sigrok_capture() + capture = sigrok_capture(1500) intervals = list(debounce(capture)) intervals = intervals[2:-1] # ignore partial first and last intervals |