Configure a GPIO/ADC based input controller
Configuring a gpio
input controller allows you to use a GPIO or ADC based device to communicate with your robot.
Configuration
Refer to the following example configuration for an input controller of model gpio
with a GPIO based device serving as the board component.
Be aware that complete configuration is not visible in the “Config Builder” tab:

{
"components": [
{
"name": <your-gpio-input-controller>,
"type": "input_controller",
"model": "gpio",
"attributes": {
"board": <your-GPIO-board>,
"buttons": {
<name>: {
"control": <button-control>,
"invert": false,
"debounce_msec": 5
},
<name>: {
"control": <button-control>,
"invert": true,
"debounce_msec": 5
}
},
"axes": {
<name>: {
"control": <axis-control>,
"min": 0,
"max": 1023,
"poll_hz": 50,
"deadzone": 30,
"min_change": 5,
"bidirectional": false,
"invert": false
},
<name>: {
"control": <axis-control>,
"min": 0,
"max": 1023,
"poll_hz": 50,
"deadzone": 30,
"min_change": 5,
"bidirectional": true,
"invert": true
}
}
},
"depends_on": [
<your-GPIO-board>
]
}, ...
}
{
"components": [
{
"name": "my_gpio_ic",
"type": "input_controller",
"model": "gpio",
"attributes": {
"board": "piboard",
"buttons": {
"interrupt1": {
"control": "ButtonNorth",
"invert": false,
"debounce_msec": 5
},
"interrupt2": {
"control": "ButtonSouth",
"invert": true,
"debounce_msec": 5
}
},
"axes": {
"analogReader1": {
"control": "AbsoluteX",
"min": 0,
"max": 1023,
"poll_hz": 50,
"deadzone": 30,
"min_change": 5,
"bidirectional": false,
"invert": false
},
"analogReader2": {
"control": "AbsoluteY",
"min": 0,
"max": 1023,
"poll_hz": 50,
"deadzone": 30,
"min_change": 5,
"bidirectional": true,
"invert": true
}
}
},
"depends_on": [
"piboard"
]
}, ...
}
The following attributes are available for gpio
input controllers:
Name | Inclusion | Description |
---|---|---|
board | Required | The name of the board component with GPIO or ADC pins to use as the controlling device. |
buttons | Required | The Buttons available for control. These should be connected to the GPIO/ADC board.Each buttons’s fields: |
axes | Required | The Axes available for control. These should be connected to the GPIO/ADC board.Each axis’s fields: |
Troubleshooting
You can find additional assistance in the Troubleshooting section.
You can also ask questions in the Community Discord and we will be happy to help.