# General-Purpose Input/Output (GPIO)

> A chip pin your code can use to switch things on or read a button.

**Field:** Software Development  
**Category:** Embedded & IoT  
**Also known as:** GPIO, GPIO Pin, Digital Pin, I/O Pin

## Think of it like

It is like a light switch your code can flip, or a bell your code can hear.

## Definition

A GPIO pin is a pin on a chip that your code can use as an input or an output. As an output, it is set high or low, which turns a light or a motor on or off. As an input, it reads high or low, such as a button that is pressed or not. Your code picks the job for each pin. Most boards have many of them along their edge.

## Example

On a Raspberry Pi, Lucy sets GPIO 17 as an output. When her code sets it high, an LED on that pin lights up.

## Why it matters

It is how code reaches the real world. Every light, button and buzzer on a board goes through one.

## Common mistake

Mixing up the pin's number on the chip with its place on the header. They are often different, so check the pin map.

## Three principles

- **In or out.** Code picks the pin's job.
- **High or low.** On or off, nothing between.
- **Check the volts.** Each board has a safe level.

## Related terms

- [Microcontroller (MCU)](https://learn.benibix.com/term/development/microcontroller)
- [Pulse-Width Modulation (PWM)](https://learn.benibix.com/term/development/pulse-width-modulation)
- [Analog-to-Digital Converter (ADC)](https://learn.benibix.com/term/development/analog-to-digital-converter)
- [Interrupt (Hardware)](https://learn.benibix.com/term/development/interrupt)
- [Arduino](https://learn.benibix.com/term/development/arduino)
- [Raspberry Pi](https://learn.benibix.com/term/development/raspberry-pi)

![Four rows, one per kind of pin signal. GPIO: a line that is either high or low, on or off. ADC: a knob turns a smooth voltage into a number from 0 to 1023. PWM: two square waves, one on a quarter of the time for a dim light and one on three quarters of the time for a bright one. Interrupt, lit up: a button press makes the chip stop its loop at once, run a short handler, then go back.](https://learn.benibix.com/diagrams/dev4-pin-signals.svg)

---

Source: https://learn.benibix.com/term/development/gpio
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
