Import
Methods
Method Reference
Net.get(name, type=NetType.GPIO)
Get a GPIO net by name.
Returns: GPIO Net instance
input()
Read the digital state of the pin.
int - 0 for LOW, 1 for HIGH
output(level)
Set the digital state of the pin.
wait_for_level(level, timeout=None, ...)
Wait for the pin to reach a target level. Blocks until the pin reads the specified level or the timeout expires.
The LabJack T7 uses hardware streaming at up to 20 kHz for fast edge detection. Other hardware uses software polling.
Returns:
float - Elapsed time in seconds until the level was detected
Raises: TimeoutError if the timeout expires before the target level is reached
Hardware-specific behavior:
Examples
Read Button State
Control LED
Wait for Interrupt
Button-Controlled LED
Toggle Output
Supported Hardware
Pin Naming
LabJack T7:
MCC USB-202:
Notes
- GPIO nets work directly without
enable()/disable()calls input()returns 0 or 1output()accepts integers (0/1) or strings (“high”/“low”, “on”/“off”, “true”/“false”)wait_for_level()blocks the calling thread until the target level is detected- LabJack T7
wait_for_level()uses hardware streaming for sub-millisecond detection - Net names must match those configured on the Lager Box

