Get Started
I/O Device

I/O Device

Settings → I/O Device registers the sensors, motors, displays, and other devices used by the I/O Device Control action. See Part 7 for the list of supported devices and how their commands are organized. The fields in the registration dialog depend on the type of the selected device.

  1. Enter a Name. Any name can be used.
  2. Under GPIO, choose where the device is wired: the controller board's onboard GPIO or a USB-GPIO adapter. Choosing USB-GPIO shows a USB GPIO field for picking an adapter registered under External GPIO.
  3. Click the I/O Device field to open the device list, then search for the device and select it. The list appears only after GPIO has been chosen. Once a device is selected, Description and Type are filled in automatically.
  4. Enter the connection fields for the type, as listed in the table below.
  5. Check the values under Initialization Commands and save.
TypeFieldDescription
I2CInterfaceShown for onboard GPIO only. Choose Hardware or Software.
I2C Bus, SDA Pin, SCL PinThe hardware interface takes the I2C Bus number; the software interface takes the GPIO numbers of the SDA Pin and SCL Pin.
I2C AddressPick from the list or type it in; typed values use hexadecimal form such as 0xFF. See the Appendix for how to find the address of a connected device.
SPIInterfaceShown for onboard GPIO only. Choose Hardware or Software.
SPI Bus, Chip Select (CS), four pinsThe hardware interface takes the SPI Bus number and the Chip Select (CS) number; the software interface takes the GPIO numbers of the CS Pin, SCLK Pin, MISO Pin, and MOSI Pin.
UARTPortThe serial port the device is connected to; find it with the search button or type it in (e.g. COM3 on Windows, /dev/ttyACM0 on Linux).
ONE_WIRE1-Wire IDClick Scan to list every connected 1-Wire device, then pick one from the list.

With a USB-GPIO adapter selected, the interface, bus, and pin fields are not shown; only the I2C address, port, or 1-Wire ID is entered, depending on the type.

Interface

  • Hardware: Uses the board's hardware I2C or SPI interface. Fast and stable, but limited to the dedicated GPIO pins.
  • Software: Implements the I2C or SPI protocol in software (bit-banging). CPU load rises and it is slower, but any GPIO pin can be used.
Note The software interface is currently available only on the GPIO of a Raspberry Pi 0 to 4.

The hardware I2C and SPI bus numbers are printed on each board's pin map. On a Raspberry Pi the I2C bus is 1 (GPIO 2 SDA, GPIO 3 SCL) and the SPI bus is 0 (GPIO 10 MOSI, GPIO 9 MISO, GPIO 11 SCLK).

Raspberry Pi pin map crop highlighting the I2C1 label on GPIO 2 and 3
The I2C1 label on the Raspberry Pi pin map. The I2C bus number is 1.
Raspberry Pi pin map crop highlighting the SPI0 label on GPIO 9, 10, and 11
The SPI0 label on the Raspberry Pi pin map. The SPI bus number is 0.

Initialization Commands

Initialization commands are the device commands needed to start the device, and each takes its own values. When RUN is clicked on the controller, the initialization commands of every registered I/O device run automatically and initialize the device.

Note Clearing the checkbox of an initialization command stops it from running automatically. It can then be run at the moment of your choosing from Action → I/O Device Control.