Build Your Own AI Assistant Part 1 - Creating the Assistant
116820 Views
Is the new Raspberry Pi AI Kit better than Google Coral?
114678 Views
Control Arduino with Python using Firmata / PyFirmata
87081 Views
How to Map with LiDAR - using a Raspberry Pi Zero 2W, RPLidar and Rviz
57314 Views
Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
53588 Views
Node-Red Automation, MQTT, NodeMCU & MicroPython
52067 Views
LEGO Gets Lights & Sound with Tiny FX
Thinkman
Podman vs Docker
MicroPython Robotics
Bottango and Isaaca
LidarBot
Getting Started with C on the Raspberry Pi Pico
0h 20m
Running K3s on Raspberry Pi
0h 36m
From Docker to Podman
0h 28m
MicroPython Robotics Projects with the Raspberry Pi Pico
0h 24m
Bottango Basics
0h 22m
Mini-Rack 3D Design Tutorial
Learn how to Program in Python, C, Rust, and more.
Learn Linux from the basics to advanced topics.
Learn how to use a Raspberry Pi Pico
Learn MicroPython the best language for MicroControllers
Learn Docker, the leading containerization platform. Docker is used to build, ship, and run applications in a consistent and reliable manner, making it a popular choice for DevOps and cloud-native development.
Learn how to build SMARS robots, starting with the 3D Printing the model, Designing SMARS and Programming SMARS
Learn how to build robots, starting with the basics, then move on to learning Python and MicroPython for microcontrollers, finally learn how to make things with Fusion 360.
Learn Python, the most popular programming language in the world. Python is used in many different areas, including Web Development, Data Science, Machine Learning, Robotics and more.
Learn how to create robots in 3D, using Fusion 360 and FreeCAD. The models can be printed out using a 3d printer and then assembled into a physical robot.
Learn how to create Databases in Python, with SQLite3 and Redis.
KevsRobots Learning Platform
80% Percent Complete
By Kevin McAleer, 3 Minutes
Page last updated June 15, 2025
Now that you’ve written a program and sent it to your Raspberry Pi Pico, it’s time to interact with the real world using the Pico’s GPIO pins.
GPIO stands for General Purpose Input/Output — these are the physical pins on your Pico that can send or receive digital signals.
⚠️ Be sure to connect the long leg (anode) of the LED to the GPIO pin, and the short leg (cathode) to GND through the resistor. You can use the mnemonic - ‘long is live’ to remember that the long leg is positive (anode) and connects to the GPIO pin.
⚠️ Be sure to connect the long leg (anode) of the LED to the GPIO pin, and the short leg (cathode) to GND through the resistor.
You can use the mnemonic - ‘long is live’ to remember that the long leg is positive (anode) and connects to the GPIO pin.
The Raspberry Pi Pico has 26 usable GPIO pins (0–28, skipping 23–24).
Each pin can be configured as:
Here’s the simplest GPIO example — we’ll just turn a pin HIGH, wait a bit, then turn it LOW.
#include "pico/stdlib.h" int main() { const uint LED_PIN = 15; gpio_init(LED_PIN); gpio_set_dir(LED_PIN, GPIO_OUT); while (true) { gpio_put(LED_PIN, 1); // HIGH sleep_ms(1000); gpio_put(LED_PIN, 0); // LOW sleep_ms(1000); } }
Replace 15 with the GPIO pin number you connected your LED to.
15
gpio_init(pin)
gpio_set_dir(pin, GPIO_OUT)
gpio_put(pin, value)
1
0
sleep_ms(ms)
sleep_ms()
true
false
You now know how to:
In the next lesson, you’ll combine all of this into the classic blinking LED project using your own circuit.
Next up: Blinking an LED
< Previous Next >
You can use the arrows ← → on your keyboard to navigate between lessons.
← →