Skip to main content
Read the digital input state of GPIO pins, with optional blocking wait for a target level.

Syntax

Arguments

Options


Usage

Basic Read

Wait for Level

Block until a pin reaches a target level. Useful for waiting on hardware events like button presses, interrupt lines, or device ready signals.

Advanced Streaming Options

For LabJack T7 hardware, the --wait-for command uses high-speed streaming to detect level changes. You can tune the streaming parameters:

Output

Basic Read

Returns the digital state:
  • 0 - Low (0V)
  • 1 - High (3.3V or 5V depending on hardware)

Wait for Level

Returns the elapsed time in seconds when the target level is reached:
If the timeout expires before the target level is reached, the command exits with an error.

Supported Hardware

Aardvark and FT232H GPIO support is currently disabled and may be re-enabled in a future release. LabJack T7 and MCC USB-202 are the active GPIO backends.

Aardvark Pin Mapping

The Aardvark I2C/SPI adapter exposes 6 GPIO pins on its 10-pin header. Pins can be specified by number or signal name:

FT232H Pin Mapping

The FT232H provides 16 GPIO pins across two ports:

Examples



Notes

  • GPI is for reading input pins only
  • Use lager gpo to set output pins
  • Default net can be set with lager defaults add --gpio-net
  • Pin must be configured as input in net configuration
  • USB-202 channels can be specified as 0-7 or DIO0-DIO7
  • --wait-for blocks the process until the target level is detected or the timeout expires
  • --scan-rate and --scans-per-read only apply to LabJack T7 streaming; they are ignored by other drivers
  • --poll-interval applies to non-streaming drivers (USB-202, Aardvark, FT232H); ignored by LabJack