frequencyio — Support for frequency based protocols

The frequencyio module contains classes to provide access to basic frequency IO.



This module is not available in SAMD21 builds. See the Support Matrix for more info.

All classes change hardware state and should be deinitialized when they are no longer needed if the program continues after use. To do so, either call deinit() or use a context manager. See Lifetime and ContextManagers for more info.

For example:

import frequencyio
import time
from board import *

frequency = frequencyio.FrequencyIn(D13)
frequency.capture_period = 15

This example will initialize the the device, set capture_period, and then sleep 0.1 seconds. CircuitPython will automatically turn off FrequencyIn capture when it resets all hardware after program completion. Use deinit() or a with statement to do it yourself.