Push Button Input
Overview
Reads the state of a push button.

Supported GPIO
- Raspberry Pi 0~4
- Raspberry Pi 5
- BeagleBone Black/Green
- Jetson Nano
- FT232H, FT2232H, FT4232H
- MCP2221
- NUMATO USB-GPIO (8~128CH)
Commands
[INIT]
Configures initial settings for the push button input.
Item | Type | Description |
---|---|---|
GPIO Pin | WRITE | Enter the GPIO pin number to use. |
Pull Up/Down * | WRITE | Configure internal GPIO pull-up/pull-down resistor (Off, Pull Down, Pull Up). |
Invert | WRITE | Set whether to invert the input signal. |
* Works only with Linux kernel 5.10 or higher (Raspberry Pi OS, Ubuntu 22+, Debian 11+)
* For pull-up/pull-down explanation, refer to here.
* For pull-up/pull-down explanation, refer to here.
[READ_VALUE]
Reads the current state of the push button.
Item | Type | Description |
---|---|---|
Value | READ | Current state of the push button (pressed/released). |
Example
Objective
Display the push button state on a dashboard lamp widget.
Parts
Part | Quantity |
---|---|
Raspberry Pi 4 * | 1 |
Push Button | 1 |
* Other compatible hardware may be used. See Supported GPIO for details.
Wiring
Connect each component to the corresponding connection as listed in each row below.
Component 1 | Component 2 | GPIO |
---|---|---|
Push Button Pin 1 | | 3.3V |
Push Button Pin 2 | | 4 |
