Skip to content
BENIBIX Learn

General-Purpose Input/Output (GPIO)

Development🔌 Embedded & IoTInputs and Outputs

Also known as GPIO, GPIO Pin, Digital Pin, I/O Pin

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

Think of it like

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

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.

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.
A GPIO pin, top row, is only ever high or low.

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.

Key takeaways

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